Optional
props: StaticProps & MutablePropsProtected
_callbacksCallbacks instance
Protected
_destroyableStores actions that need to be executed when the module is destroyed
Protected
_isTracks whether the module has been destroyed
Protected
_isIndicates if the preloader has already been hidden.
Protected
_isIndicates if the page is fully loaded.
Protected
_propsCurrent properties
Protected
_shouldIndicates if the preloader is in the process of being hidden.
Retrieves the module's callbacks instance.
Checks if the module has been destroyed.
Returns whether the preloader is currently hidden.
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Current properties. Do not mutate these directly, use updateProps
instead.
Protected
_addAdds a class name on an element, and keeps track of it for removal when the module is destroyed.
The target DOM element.
The class name to toggle.
Protected
_cnHelper function to generate classnames with the module's prefix.
The class names to generate.
A string of class names with the module's prefix applied.
Protected
_destroyInternal method to handle the destruction of the module. It removes all callbacks, destroys properties, and cleans up event listeners and class names.
Retrieves the default mutable properties.
Retrieves the default static properties.
Protected
_handleHandles the logic that occurs after the page is fully loaded.
Protected
_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
Protected
_hideExecutes the hiding animation for the preloader container.
Protected
_onHandles actions when the preloader is fully hidden.
Protected
_onHandles the page load event, triggering when the page is fully loaded.
Destroys the module, cleaning up resources, callbacks, and event listeners.
Hides the preloader with a custom animation duration.
The duration of the hide animation (in milliseconds). Applies only when the container is used.
Optional
callback: () => voidThe callback to execute when the hide animation is complete.
Returns an action destructor.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Adds a callback on the module's destruction.
The function to execute during destruction.
Registers a callback for when the preloader is fully hidden.
The callback function to execute.
A destructor.
Registers a callback for when the preloader starts hiding.
The callback function to execute.
A destructor.
Page preloader component that manages the visibility and lifecycle of a loading screen. The module does not provide styling for the container.
Documentation