# Figure

> A picture, a chart or a drawing with a line about it underneath: the media on a grey plate with 12px corners, the caption in label type.

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

## Install

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

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

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 |
|---|---|---|---|
| `children` | slot |  |  |
| `caption` | slot |  |  |

## Anatomy

- `root`: A `<figure>`: the plate, then the caption, 8px apart.
- `media`: The plate, in Card's grey, with 12px corners that clip what's in it. Whatever's smaller than it sits in the middle.
- `caption` (optional): The `<figcaption>`, in label type and the tertiary grey.

## When to use

- **Something to look at, with a word on it.** A screenshot in a case study, a chart in a report, a diagram in the docs. The caption says what to notice.

## When not to use

- **Decoration.** A picture that's only there for mood needs no caption and no plate. That's **HeroMedia** or the image on its own.

## Behaviour

It lays the media on its plate and the caption under it. It doesn't size the picture: an `<img>` gets the plate's width, anything else keeps its own size and sits in the middle.

## Accessibility

- **Element**: `<figure>` with a `<figcaption>`, so the caption is read as the figure's description.
- **Name**: The image still needs its own `alt`. The caption adds to it, it doesn't replace it.
- **Colour**: The caption is 7:1 on the dark page.

## Content

Say what to see, not what it is: Payments come in faster after the reminder, rather than Chart of payments.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `figure/caption` | `#999999` |
| `figure/media` | `#171717` |
| `font-family/base` | `'General Sans Variable'` |
| `spacing/gap/none` | `0px` |
| `spacing/gap/small` | `8px` |
| `spacing/radius/medium` | `12px` |
| `typography/label/font-size` | `12px` |
| `typography/label/font-weight/regular` | `400` |
| `typography/label/letter-spacing` | `0px` |
| `typography/label/line-height` | `14px` |

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