Use on a marketing page or gallery where the pointer should name what is clickable: a ball, a pill with speed, a tile around links and buttons, a caret over text. Keyboard focus moves it too.
When not to use
Not for dense app screens: use the native preset or no custom cursor. It is not drawn on touch screens. For a card-level pointer effect use Spotlight Card.
Use Morph Cursor on a product site's features band, a template gallery or a whole marketing page:
the pointer becomes a 12 px ball that stretches into a pill when it moves fast, morphs into a tile
that wraps every link and button it reaches and thins into a caret over text, so the cursor names
what the page lets you do. Keep it off dense app screens; there, pick the native preset (the
system cursor stays and the layer only wraps targets) or no cursor at all.
import { MorphCursor } from "@/components/ui/morph-cursor"export function FeaturesBand() { return ( <MorphCursor hideNative initialTarget="[data-rest]" className="rounded-2xl border p-8"> <p>Version 4.2 adds exports, an audit trail and finer roles.</p> <button data-rest="">See the changelog</button> </MorphCursor> )}
scope="container" (the default) keeps the cursor inside the component's box; scope="page"
puts it on a fixed layer over the whole document (wrap your layout once) and hides the system
cursor by default. targets is the selector list of what gets wrapped (links, buttons, inputs and
[data-cursor] by default). Mark elements by hand with data-cursor, or spread
useCursorTarget(kind) on a custom component:
data-cursor
The cursor
wrap
wraps the element in a tile (its box + 4 px, its radius + 4 px)
text
becomes a 2 px caret, 1 em tall (paragraphs and headings do it too)
label:<text>
wraps it and, in the label preset, grows a label pill ("Preview")
none
fades out over the element (a video, a canvas with its own pointer)
initialTarget is the rest pose: the cursor wraps that element when the section comes into view
(a ball that grows into the tile) and goes back to it when the pointer leaves. preset picks the
configuration: wrap (default), label (adds the label pill, for galleries and cards) or native
(the system cursor stays, no ball). temperament tunes only the motion: calm keeps a short pill
and wraps without overshoot, playful stretches up to three diameters and lands the tile with a
bounce.
The cursor layer is aria-hidden, has no focusable parts and never takes pointer events: every
click lands on the element under it.
The layer mounts only for a fine pointer (pointer: fine) and outside forced colors. On touch
screens, and in Windows high-contrast mode, nothing is drawn and the native cursor is never hidden.
The tile is a solid slab tinted at 14% (light) or 20% (dark) of foreground (or primary), with
no rim, so it never reads as a focus ring; the text under it keeps its contrast in both themes. It sits 4 px outside the target, so the element's own
focus-visible ring stays visible inside it.
hideNative restores the system cursor on unmount, even mid-hover.
The ball is not drawn and the native cursor stays, whatever hideNative says. Links, buttons and
fields still get the quiet rim and tint on hover and keyboard focus, crossfaded in place in the
fade time: no travel, no stretch, no press squash. The label pill fades instead of growing.
One fixed or absolute layer with two shape elements, driven by Motion values: no React render
per pointer move. The pill's length and heading are read from the position spring's velocity.
The wrap animates width, height and borderRadius on one small, absolutely positioned
element (the suite's pill exception); position, rotation, press and fades are transforms and
opacity.
Targets are measured once per change (getBoundingClientRect) and re-measured on scroll,
resize and container resize (passive listeners, one ResizeObserver), never inside a frame
loop. All listeners are removed on unmount.
Works inside scaled containers (docs stages, transformed previews): coordinates are corrected
by the container's scale.
Dependencies: motion only (peer).
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
Dependencies
motion · peer
Triggers
pointer movement, hover, keyboard focus, press, entering the viewport
Reduced motion
No ball and the native cursor stays; the rim and tint around targets crossfade in place on hover and keyboard focus.
Keyboard
Tab
Moves focus; the cursor jumps to the focused element and wraps it
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)