Skeleton
Pulsing placeholders while content loads.
Example
import { Skeleton } from "@porcelana/ui";
export default function Example() {
return (
<div role="status" aria-busy="true" aria-label="Loading alarms" style={{ display: "flex", gap: 12, alignItems: "center", maxWidth: 420 }}>
<Skeleton circle height={44} />
<div style={{ flex: 1, display: "grid", gap: 8 }}>
<Skeleton width="70%" />
<Skeleton width="45%" />
</div>
</div>
);
}Import
import { Skeleton } from "@porcelana/ui";
import "@porcelana/ui/styles.css"; // once, at your app rootProps
Generated from the TypeScript types. Standard HTML attributes are passed through and not listed.
Skeleton
Loading placeholder. Hidden from assistive tech; announce loading state on the container (aria-busy).
| Prop | Type | Default | Description |
|---|---|---|---|
aria-label | string | – | Defines a string value that labels the current element. @see aria-labelledby. |
circle | boolean | – | Round placeholder, e.g. for an avatar. |
height | Height<string | number> | 12 | CSS height; also the diameter of a circle. |
id | string | – | Element id. Generated automatically when omitted. |
width | Width<string | number> | 100% | CSS width, e.g. 120 or "70%". |
Accessibility
- Hidden from screen readers; mark the loading region with aria-busy and a label instead.
- The pulse stops when reduced motion is on.