Liquid GlassAPI Reference
Liquid GlassAPI Reference
createLiquidCursor
Glass orb cursor that follows the mouse with spring physics.
createLiquidCursor
Creates a glass orb that replaces or follows the default mouse pointer.
Basic Usage
import { createLiquidCursor } from '@avenra/liquid-glass';
const cursor = createLiquidCursor('body', {
size: 100,
glassThickness: 120
});Props / Options
Extends LiquidGlassOptions plus:
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 90 | Diameter of the cursor orb in px |
Return Value — LiquidCursorHandle
| Member | Type | Description |
|---|---|---|
element | Element | The cursor orb element |
destroy() | () => void | Remove cursor and restore original pointer |
on('destroy', cb) | undefined | Fired on destruction |
Notes
When a liquid cursor is active, the container element (e.g., body) automatically gets cursor: none. The orb follows the mouse movement using damped spring physics for a fluid, laggy feel, and it scales up slightly on mouse clicks.