---
title: "Skeleton"
description: "Grey shapes in the place of content that is still loading, such as a card, a row, or lines of text. They pulse, so people see that the page works."
url: https://gelatinui.com/components/skeleton
markdown_url: https://gelatinui.com/components/skeleton.md
access: free
install: "npx shadcn@latest add @gelatin-ui/skeleton"
registry_item: https://gelatinui.com/r/skeleton.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Skeleton

> Grey shapes in the place of content that is still loading, such as a card, a row, or lines of text. They pulse, so people see that the page works.

Page: https://gelatinui.com/components/skeleton

## When to use it

Best for: A placeholder in the shape of content that loads: a card, a row, an avatar, or text.

- Use it where content of a known shape loads: a card, a row, an avatar, a paragraph.
- Use `SkeletonText` for lines of text, so the block is as tall as the text.
- Set `pulse={false}` where something else already shows that the page works.

## When not to use it

- For a wait with no known shape, use a Spinner. [Spinner](https://gelatinui.com/components/spinner.md).

## Notes for agents

- Give it the size and the corner of the content it stands for, so the page does not shift when the content comes.
- It is hidden from screen readers; use `SkeletonText` for lines of text.

## Anatomy

```text
Skeleton
└─ SkeletonText (0..n)
```

## API reference

### Skeleton

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `pulse` | `boolean` | true |  |
| `rounded` | `"default" \| "full"` | "default" |  |

Also takes every prop of Base UI `UseRender`: https://base-ui.com/react/components/use-render

### SkeletonText

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `text` | `"meta" \| "prose" \| "title" \| "ui"` | "ui" |  |
| `lines` | `number \| readonly number[]` | 3 | How many lines (default 3), or the width of each line as a fraction of the box (0 to 1): the measured lines of a known layout, so the bars end where the text will end. |
| `pulse` | `boolean` | true | Pulse the bars (default `true`); `false` holds them still. |
| `lineClassName` | `string` |  | Classes of each bar (a corner, `rounded="full"` for word pills). |
| `rounded` | `"default" \| "full"` | "default" | The corner of each bar. Default `default`. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Skeleton | `skeleton` |  |  |  |
| SkeletonText | `skeleton-text` |  | `--skeleton-line-width` |  |

## Usage

Size the Skeleton as the content that comes, so nothing moves when it arrives. The bars are hidden from screen readers, so put `aria-busy` on the region that loads.

```tsx title="comment-skeleton.tsx"
import { Skeleton, SkeletonText } from "@/components/ui/skeleton";

export function CommentSkeleton() {
  return (
    <div aria-busy="true" className="flex gap-3">
      <Skeleton rounded="full" className="size-8 shrink-0" />
      <div className="flex-1">
        <Skeleton className="my-1 h-3 w-24" />
        <SkeletonText lines={2} text="ui" />
      </div>
    </div>
  );
}
```

## Compose

Build it with:

- [Filters](https://gelatinui.com/components/filters.md): Narrows the records.
- [Data Table](https://gelatinui.com/components/data-table.md): Shows the records in rows, with sort and select.
- [Badge](https://gelatinui.com/components/badge.md): Shows the status of each record.
- [Menu](https://gelatinui.com/components/menu.md): Holds the actions of one row.
- [Pagination](https://gelatinui.com/components/pagination.md): Moves between pages.
- [Empty](https://gelatinui.com/components/empty.md): Shows when no record matches, with a next action.

Rules:

- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.
- Color has a job (`color-has-a-job`): Use color only for a status, the brand action, or data; keep the rest neutral, and show a level with a small mark (a dot, a tinted badge) before a big fill.
- Real content (`real-content`): Fill the UI with content of the real product (real names, amounts, dates, and states), never lorem text or "Item 1".
- Steady text weight (`steady-weight`): Never change the font weight on hover, focus, selected, active, or open; change the color or the fill, so the text does not jump.

Patterns: `gelatin://patterns/data-list`

## Add it

```bash
npx shadcn@latest add @gelatin-ui/skeleton
```

It adds 1 registry items: 1 files, 188 lines, and the npm packages `@base-ui/react`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Spinner](https://gelatinui.com/components/spinner.md)
- [Image](https://gelatinui.com/components/image.md)

## Accessibility

Skeleton and `SkeletonText` render `<div>` elements with `aria-hidden="true"`, so a screen reader skips them.

Put `aria-busy` on the region that loads, and remove it when the real content arrives.

The pulse changes only opacity. Set `pulse={false}` where something else already moves.

## Motion

| Part | Motion |
| --- | --- |
| Pulse | animate-pulse · 2s · cubic-bezier(0.4, 0, 0.6, 1) · repeats · opacity 100% → 50% → 100% |
