Skeleton
Quiet loading shapes that reserve space while real content arrives.
Interactive preview
Loading profile
Usage
import { Skeleton } from "@devvy-ui/react";
<section aria-busy={loading} aria-label="Profile">
{loading ? <Skeleton variant="rect" height={120} /> : <p>Profile loaded.</p>}
</section>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | text | circle | rect | text | Placeholder shape. |
| animated | boolean | true | Opacity pulse; disabled automatically for reduced motion and forced colors. |
| width / height | CSSProperties dimensions | shape default | Reserve the expected content dimensions. style can override. |
Accessibility & behavior
Platform Behavior & Guidelines
Always decorative and aria-hidden. No children, focus or interaction API. Put aria-busy on the enclosing content region and provide one readable loading status outside it. Replace shapes with content when ready. Error and disabled states belong to that content, not to the skeleton. Supports span refs, className, style and theme variables.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add skeletonMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.