Elastic Blob Cursor
A soft white blob that chases the pointer with inertia, stretches along the direction of travel, and relaxes back into a circle when you slow down.
Installation#
pnpm dlx shadcn@latest add @davinciui/elastic-blob-cursorUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
sizeBlob diameter in pixels at rest. | number | 60 |
colorSolid fill. Used for both themes unless overridden. | string | "#FFFFFF" |
lightColorFill on light backgrounds (only when color is default). | string | "#18181B" |
darkColorFill on dark backgrounds. Defaults to color. | string | — |
themeColor scheme. Auto follows the site theme live. | "auto" | "light" | "dark" | "auto" |
followStrengthPosition interpolation per frame (0.12–0.20). Higher is tighter. | number | 0.16 |
maxStretchMaximum stretch along travel (1.4 = 140% width at full speed). | number | 1.4 |
compressionMaximum cross-axis compression amount (0.22 → down to 78% height). | number | 0.22 |
velocitySensitivityHow strongly pointer speed maps to deformation. | number | 0.8 |
rotationSmoothingShortest-arc rotation interpolation per frame. | number | 0.15 |
deformationSmoothingStretch interpolation while deforming; recovery is slower. | number | 0.18 |
modeFollow across the viewport, or stay inside containerRef. | "global" | "container" | "global" |
hideNativeCursorHide the browser cursor while active on fine-pointer devices. | boolean | true |
zIndexOverlay stacking order. | number | 9999 |
disabledTurn the cursor off without unmounting it. | boolean | false |
disableManualInputIgnore real pointer input; follow only synthetic/programmatic movement (self-playing previews). | boolean | false |
containerRefHost that constrains tracking/rendering. Required for container mode. | RefObject<HTMLElement> | — |
classNameAdditional class name applied to the cursor element. | string | — |
Accessibility#
The blob is purely decorative: aria-hidden, pointer-events none, and never focusable, so it adds no keyboard or screen-reader surface. It runs only for fine pointers, and hiding the native cursor is scoped to that active state.
Motion#
A requestAnimationFrame loop interpolates position and deformation, tuned by followStrength, maxStretch, compression, velocitySensitivity, and the smoothing props; only opacity and color use short CSS transitions. It detects prefers-reduced-motion and disables itself entirely, restoring the native cursor.
Known constraints#
- Runs only for fine pointers and restores the native cursor on touch devices.
- Reduced motion skips the pointer loop rather than slowing it down.
- The blob is an overlay; it does not replace hover or focus styles on the underlying page.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

