Skeleton: Wrap real content
With loading, the skeleton renders the real content invisibly underneath, so it takes the exact size and nothing shifts when the data arrives. When loading turns false, the content fades in.
This adds the example as components/examples/skeleton/wrap-content.tsx, together with the Skeleton component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/skeleton-wrap-content.jsonTo add only the component, follow the Skeleton installation.
Props in this example
The Skeleton props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
loadingWhen set, the skeleton wraps its children: true shows the placeholder, false shows the content. Leave it out for a standalone placeholder. | boolean | – |
Every prop is in the Skeleton API reference.
See them all, with keyboard support and accessibility notes, on the Skeleton page.
- AlertInline messages for status and feedback, with a neutral surface, a colored icon and a dismiss that collapses smoothly.
- EmptyA placeholder for screens with nothing to show yet, with an icon, a message and the next action.
- ProgressA bar or ring that shows how far a task has come, eases between updates and slides while the total is unknown.
- SpinnerA loading indicator with Apple-style ticks or a breathing ring that can wait before showing and stay long enough not to flicker.
- ToastBrief messages that stack neatly, expand on hover, swipe away, and turn a loading state into success or error in place.
- Aspect ratioA box that holds its shape before media loads, shimmers while loading, fades the media in and falls back when it fails.