# Skeleton

> Grey shapes where content is about to be, so the page doesn't jump when it arrives. A line of text, a circle or a block.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [skeleton.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/skeleton.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 733:160](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=733-160) · read 2026-11-16 · frozen 2026-11-16 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/skeleton/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add skeleton
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `shape` | enum | `text` `circle` `block` | `text` |
| `width` | string |  |  |
| `height` | string |  |  |

## Anatomy

- `root`: A `<span>`, hidden from screen readers. Whatever holds the skeletons says it's loading (`aria-busy`).

## When to use

- **Content on its way.** A list, a card or a table whose shape you know before its data arrives. Draw the shape, then swap it.

## When not to use

- **Long waits.** Anything that takes more than a few seconds, or where you know how far along it is. That's **Progress**.
- **Buttons.** A button that's working on something keeps its place and says so itself.

## Behaviour

Plain grey shapes, matched to what's coming: give text lines uneven widths, the last one shorter. They fade slowly between full and 48%, and back, every 1.8 seconds. For someone who asks for less motion they stay still.

## Accessibility

- **Element**: A `<span aria-hidden="true">`. Screen readers skip them.
- **Name**: None. Put `aria-busy="true"` on the part of the page that's loading, and take it off when the content is in.
- **Colour**: Decoration, so no contrast minimum. It's the tertiary grey, which shows on the page and on a card.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `motion/easing/in-out` | `ease-in-out` |
| `skeleton/background` | `#3a3a3a` |
| `spacing/radius/full` | `10000px` |
| `spacing/radius/medium` | `12px` |
| `spacing/radius/xsmall` | `4px` |
| `spacing/size/3xlarge` | `80px` |
| `spacing/size/3xsmall` | `12px` |
| `spacing/size/medium` | `40px` |

See it live, with every value of every variant: [rost.build/components/skeleton/](https://rost.build/components/skeleton/)
