Skeleton
Reserve space while content is still loading.
npx shadcn@latest add @silicon-ui/skeletonInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/skeletonManually
Install the dependencies
npm install motionCopy these files into your project
- components/silicon-ui/skeleton/skeleton.tsx
- components/silicon-ui/skeleton/skeleton.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
label | string | "Loading content" |
lines | number | 3 |
avatar | boolean | false |
className | string | — |
childrenContent to reveal once loading finishes. With children, the placeholder crossfades into them. | ReactNode | — |
loadingKeeps the placeholder visible while true. Only used together with children. | boolean | true |
Dependencies
- npm
- motion
- Registry
- silicon-motion-tokens