Components / Data display
Skeleton
Grey placeholder shown while content loads.
import { Skeleton } from "@stylhero/ui";
Example
Code
import { Skeleton, Stack } from "@stylhero/ui";
function SkeletonExample() {
return (
<Stack direction="row" gap={3} align="center">
<Skeleton variant="circle" width={48} height={48} />
<div style={{ flex: 1 }}><Skeleton lines={3} /></div>
</Stack>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
height |
CSSProperties["height"] |
- | |
lines |
number |
1 |
For text: number of lines (the last one is shorter). |
variant |
"text" | "rect" | "circle" |
"text" |
|
width |
CSSProperties["width"] |
- |
Also takes every <span> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.
Accessibility
- Hidden from screen readers (
aria-hidden); announce loading elsewhere, e.g. witharia-busyon the region.
Generated from src/components/Skeleton.tsx. Something wrong or missing? Open an issue.