Skeleton
npx shadcn add @klarhimmel/skeletonCopy for AIExamples
Card
List
Text
DetailsAbout, usage, props and more
A pulsing placeholder for content that is on its way. It stops pulsing when motion is reduced.
When to use
Use for
Content that loads in a moment, shaped like what will replace it.
Not for
Long jobs. Show progress and say what is happening.
Pairs with
Card, lists, SkeletonText for paragraphs.
Preview
Import
Import
- Files
- skeleton.tsx, in components/klarhimmel/ui/. With it: theme, utils.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
Skeleton.className | string | - | Size it with width and height classes (Skeleton). |
SkeletonText.lines | number | 3 | Number of lines; the last is shorter (SkeletonText). |
SkeletonText.label | string | 'Loading' | What is announced once for the group (SkeletonText). |
SkeletonText.className | string | - | Size it with width and height classes (Skeleton). |
Accessibility
| Key | Does |
|---|---|
Tab | Skips it: a skeleton is not interactive |
Screen reader | A single block is hidden. SkeletonText announces its label once, as a status |
Not interactive. Give the group a visible or spoken label (SkeletonText label) and do not leave skeletons on screen for long.
Accessibility