# Skeleton

A pulsing placeholder that keeps the row height or prose pitch of what it stands for.

Live variants: https://design.arcadia.is/components/skeleton

```tsx
import { Skeleton } from "@arcadia/ui";
```

```tsx
import { ListRow, Skeleton } from "@arcadia/ui";

<div {...sx("cmp-stream", cmp.stream)} aria-busy="true">
  <div {...sx("cmp-prose", cmp.prose)}>
    <Skeleton lines={["64%", "88%", "40%"]} />
  </div>
  <div {...sx("cmp-rows", cmp.rows)}>
    <ListRow
      interactive={false}
      leading={<Skeleton shape="circle" width="var(--space-4)" />}
      label={<Skeleton width="48%" />}
    />
    <ListRow
      interactive={false}
      leading={<Skeleton shape="circle" width="var(--space-4)" />}
      label={<Skeleton width="62%" />}
    />
  </div>
</div>
```

## Accessibility

Always decorative (`aria-hidden`): announce loading on the container with `aria-busy`, as above, or with text. With reduced motion it holds still at its resting tint.

## API reference

### Skeleton

- `shape` (`"text" | "block" | "circle"`, default `"text"`): `text`: one line of the surrounding text (1lh tall) with a 6px bar centred in it, so a skeleton label keeps a row's height and a passage keeps the prose pitch. `block`: a filled rectangle (images, cards). `circle`: an avatar or icon placeholder.
- `width` (`SkeletonLength`): Width, e.g. "72%" or "var(--space-16)". Default 100% (circle: 24px; a passage: its container).
- `height` (`SkeletonLength`, default `40px`): Height for `block`.
- `lines` (`readonly SkeletonLength[]`): A passage on its way, for `text`: one line of the surrounding text per width, at its line height and no gap, pulsing as one.
- `rootStyle` (`RootStyle<SkeletonKnobs>`): Typed StyleX override: layout and the `--skeleton-*` knobs.

Rest props go to `<span>` props and `render`.
