Skeleton
Placeholder loading shape with a cursor-tinted travelling shimmer. A bright band sweeps across on a rAF loop with a hint of pastelColour mapped to cursor position.
- requestAnimationFrame
- Linear Gradient
- pastelColour
skeleton
Move your cursor to tint the shimmer.
Usage
Drop it in
import { Skeleton } from "@/app/lib/components/skeleton";<Skeleton width={200} height={16} />
<Skeleton width={40} height={40} rounded="rounded-full" />API
Props
| Prop | Type | Default |
|---|---|---|
widthWidth — number (px) or CSS string | string | number | — |
heightHeight — number (px) or CSS string | string | number | 16 |
roundedTailwind border-radius class. Default: "rounded-lg" | string | "rounded-lg" |
classNameAdditional class names | string | "" |
Read from the component's source at build time. * required.
Accessibility
Works with
- Cursor
- Reacts to where the pointer is, not just whether it's over the element.
- Touch
- Follows your finger while it's down, then settles a moment after you lift.
- Keyboard
- Focus lights it up the way the cursor does. Every action has a key.
- Reduced motion
- Nothing moves or springs. Colour still answers, without drifting.