A custom cursor and a trailing label with two different springs.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/cursor.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/cursor.json
Turn on the motion
npx @prequelui/cli@latest animate cursorThe CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.
Usage
Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.
import { Cursor } from "@/components/prequelui/cursor";
export default function Demo() {
return (
<Cursor>
{/* compose the parts exactly like the underlying primitive */}
</Cursor>
);
}import { Cursor } from "@/components/prequelui/cursor";
export function Variant() {
return (
<Cursor tempo={1.2}>
…
</Cursor>
);
}Animation
The point is glued to the pointer with no lag; the label trails behind on a softer spring. The two use different stiffness values on purpose, so the cursor feels precise while the label feels elastic.
- Cursor entry: 550 / 30 with restSpeed 10.
- Label follow: 500 / 50 with no bounce.
- Touch pointers are ignored entirely.
- Leaving the parent fades the cursor out without a jump.
API Reference
Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.
Cursor
| Prop | Type | Default |
|---|---|---|
| children | ReactNode | — |
| disabled | boolean | false |
| transition | Transition | spring.press |
| className | string | — |