# Disclosure

> A line that opens to show more, for things most people won't need.

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

## Install

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

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

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 |
|---|---|---|---|
| `summary` | slot |  |  |
| `open` | boolean |  | `false` |
| `children` | slot |  |  |

## States

`Default` · `Hover` · `Focus` · `Open`

## Anatomy

- `root`: A `<details>`, so it opens without any script.
- `summary`: The `<summary>`: the chevron, then the words.
- `icon`: Icon's `chevron-right`, turning down when it's open.
- `panel`: What opens, under the summary.

## When to use

- **The long version.** A component's full source, a whole contract, the raw SVG. There for the few who want it, out of the way for the rest.

## When not to use

- **Things everyone needs.** Hiding what most people came for. If they'd open it every time, show it.
- **Switching views.** Choosing between views of the same thing. That's **Tabs**.

## Behaviour

A line with a chevron. Clicking it, or Enter and Space on it, opens what's under it and turns the chevron down. It's a `<details>`, so it works before any script runs and the browser's find-in-page opens it when there's a match inside.

## Accessibility

- **Element**: `<details>` and `<summary>`. The browser says whether it's open.
- **Keyboard**: Tab to the summary, Enter or Space to open and close.
- **Icon**: `aria-hidden`. The open state is said by the element, not by the chevron.

## Content

A few words saying what's inside, as a noun ("The SVG", "Source"). Not "Click to show".

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `actions/primary/focus/focus-ring` | `#b6ffda` |
| `font-family/base` | `'General Sans Variable'` |
| `motion/duration/fast` | `150ms` |
| `motion/easing/standard` | `ease` |
| `non-interactive/foreground/primary` | `#ededed` |
| `non-interactive/foreground/secondary` | `#d3d9d5` |
| `spacing/gap/2xsmall` | `4px` |
| `spacing/gap/small` | `8px` |
| `spacing/outline/medium` | `2px` |
| `spacing/radius/xsmall` | `4px` |
| `typography/paragraph/font-size` | `14px` |
| `typography/paragraph/font-weight/medium` | `500` |
| `typography/paragraph/line-height` | `20px` |

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