Avenra
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:

PropTypeDefaultDescription
sizenumber90Diameter of the cursor orb in px

Return Value — LiquidCursorHandle

MemberTypeDescription
elementElementThe cursor orb element
destroy()() => voidRemove cursor and restore original pointer
on('destroy', cb)undefinedFired 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.

On this page