Optionalprops: ICursorStaticProps & ICursorMutableProps & Partial<OptionalonCallbacks: Partial<Retrieves the module's callbacks instance.
The cursor container
The current coordinates (x, y, width, height). These are updated during cursor movement.
Returns the DOM parent for the cursor element.
The currently hovered element. Stores information about the element that the cursor is currently interacting with.
Cursor initial width
Cursor initial width
The inner element of the custom cursor. This element is nested inside the outer element and can provide additional styling.
Checks if the module has been destroyed.
The name of the module, derived from the class name
The outer element of the custom cursor. This is the visual element that represents the cursor on screen.
Returns an SVG path element which represents the cursor movement
Classname prefix for styling elements.
Current properties. Do not mutate these directly, use updateProps instead.
Target coordinates of the cursor (without smooth interpolation).
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.
Get default mutable properties
Stops rendering the cursor automatically when its coordinates and size closely match the target values.
Enables or disables the custom cursor interactions.
The initial height of the custom cursor.
Supports css units like px, rem, vw, vh, svh.
Linear interpolation factor for smooth cursor movement.
The value must be between 0 and 1, with higher values indicating faster movement.
The initial width of the custom cursor.
Supports css units like px, rem, vw, vh, svh.
Get default static properties
Appends the custom cursor to the container. Use false if you need only cursor logic and interactions.
Cursor behavior
The container where the custom cursor is active.
Use window for full-window activation.
Hides the native cursor if set to true.
Modifier for the cursor transform.
Protected_handleRegisters an element to interact with the cursor, enabling dynamic size and position changes based on hover effects.
Returns a destructor
Destroys the module, cleaning up resources, callbacks, and event listeners.
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.
Renders the cursor.
A customizable custom cursor component with smooth animations and hover interactions. Supports dynamic appearance changes and enhanced user interaction.
Documentation