A placeholder with the shape of the content that is loading. Every skeleton on the page shares one light sweep, like a single light passing over the layout. Presets for text, a profile card, a list and a media grid, and a gate that fades into the real content without moving anything.
On this page
- Loading a run list
- Profile cards
- Media grids
- Chat history
Examples
Installation
npx knowns-ui@latest add skeletonPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Skeleton from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/skeleton
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add skeleton
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/skeleton.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/skeleton, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "skeleton" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- Skeleton: className / style
-- Size and shape, e.g. h-4 w-32 or size-10 rounded-full. Backwards compatible: nothing else is required.
- SkeletonText: lines
number- Default
3 - Lines of text; the last one is shorter.
- SkeletonProfile: lines
number- Default
3 - Avatar, name and handle, then bio lines.
- SkeletonList: rows
number- Default
4 - Rows with a leading tile, two lines and a trailing pill.
- SkeletonMediaGrid: items, columns
number, 2|3|4- Default
6, 3 - 16:9 thumbnails with a caption each.
- label (every preset)
string- Default
"Loading" - The accessible name of the loading region (role=status).
- SkeletonGate: loading, skeleton
boolean, ReactNode- Stacks the skeleton and the content in one cell. When loading turns false the skeleton fades out as the content fades in (220 ms), then leaves the layout.
- SkeletonGate: children
ReactNode- The content. Render it while loading too, with empty or placeholder data, so the cell is already its final size. It is inert and hidden from assistive tech until loaded.
- Motion
-- One sweep for the whole page: a light band painted fixed to the viewport, so every skeleton shows the part passing behind it, started on the shared document clock so blocks mounted later stay in step. One background-position change per block per frame, no JavaScript per frame. Reduced motion: still blocks and an instant swap. iOS Safari ignores fixed backgrounds: each block sweeps on its own there.
| Prop | Type | Default | Description |
|---|---|---|---|
| Skeleton: className / style | - | - | Size and shape, e.g. h-4 w-32 or size-10 rounded-full. Backwards compatible: nothing else is required. |
| SkeletonText: lines | number | 3 | Lines of text; the last one is shorter. |
| SkeletonProfile: lines | number | 3 | Avatar, name and handle, then bio lines. |
| SkeletonList: rows | number | 4 | Rows with a leading tile, two lines and a trailing pill. |
| SkeletonMediaGrid: items, columns | number, 2 | 3 | 4 | 6, 3 | 16:9 thumbnails with a caption each. |
| label (every preset) | string | "Loading" | The accessible name of the loading region (role=status). |
| SkeletonGate: loading, skeleton | boolean, ReactNode | - | Stacks the skeleton and the content in one cell. When loading turns false the skeleton fades out as the content fades in (220 ms), then leaves the layout. |
| SkeletonGate: children | ReactNode | - | The content. Render it while loading too, with empty or placeholder data, so the cell is already its final size. It is inert and hidden from assistive tech until loaded. |
| Motion | - | - | One sweep for the whole page: a light band painted fixed to the viewport, so every skeleton shows the part passing behind it, started on the shared document clock so blocks mounted later stay in step. One background-position change per block per frame, no JavaScript per frame. Reduced motion: still blocks and an instant swap. iOS Safari ignores fixed backgrounds: each block sweeps on its own there. |
One light, every block
Loaded crossfade
With Shimmer Text
What it handles
- 01Draws a placeholder block you size with classes, such as `h-4 w-32`.
- 02Shares one light sweep across every skeleton on the page, so blocks mounted at different moments still sweep in step.
- 03Ships four presets: SkeletonText with a shorter last line, SkeletonProfile, SkeletonList with `rows`, and SkeletonMediaGrid with `columns`.
- 04Names each preset as a loading region through `label`, which defaults to "Loading".
- 05Swaps skeleton and content with SkeletonGate, which stacks both in one grid cell so nothing moves when `loading` turns false.
- 06Hides the content from assistive tech and from focus while `loading` is true.
States
- First render
- The sweep starts on the shared page clock
- none
- Loading
- One light band crosses every skeleton in a loop
- none
- Gate loading ends
- The skeleton fades out as the content fades in
- 180ms, ease out
- Reduced motion
- The block stays still with no band
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | The sweep starts on the shared page clock | none |
| Loading | One light band crosses every skeleton in a loop | none |
| Gate loading ends | The skeleton fades out as the content fades in | 180ms, ease out |
| Reduced motion | The block stays still with no band | 0ms |
Works with
When to use
When to use
- Placeholders that keep the layout while content loads: a block per thing, or a preset shaped like a profile, a list or a media grid.
- Swapping a skeleton for the real content without a jump: SkeletonGate crossfades in place.
When not to use
- Empty results: use Empty States.
- A short wait after an action: use Spinner.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Skeleton to my app and wire it to my own data.
- I need placeholders that keep the layout while content loads: a block per thing, or a preset shaped like a profile, a list or a media grid. Set that up with the Knowns UI Skeleton.
- Which Skeleton props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "skeleton" }) and search_docs({ query: "skeleton" }).