---
name: rost
description: Build UI with Rost, a design system with a contract for every component (rost.build). Use it whenever someone mentions Rost or their design system, whenever you add or change UI in an app that has a src/rost/ folder or contracts/rost/, and when you make a page, an artifact or a prototype that should look like Rost: a screen, a form, a component, a colour, spacing, type or an icon.
---

# Rost

Rost is my design system. Every component has a contract, a YAML file that says what it is, every value it takes and when to use it. The tokens and the React components are built from those contracts. When the code and a contract disagree, the contract wins.

Components get copied into the app, into `src/rost/<id>/`. Their contracts land in `contracts/rost/`.

## Before you build anything

1. Read https://rost.build/llms.txt. It lists every component and block, one line each, and says which are in code.
2. For each piece you think you need, read its page: `https://rost.build/components/<id>.md`. The "When to use" and "When not to use" parts matter. They often send you to another component (no room for a label is an IconButton, never a Button with its label hidden).
3. Look for a block first if you're building a whole screen: https://rost.build/blocks/. A block is a screen made only of Rost's components (`sidebar`, `login`, `dashboard`).

If the app already has the contract in `contracts/rost/<id>.contract.yaml`, that copy is the one the app was built against. Read it too.

## Installing

In the app's folder:

```sh
npx github:Runceanu/rost add button input
```

A component brings what it needs. `add` with no names updates everything the app already has. `npx github:Runceanu/rost list` says what's there.

The first time, import these once, at the root of the app:

```ts
import './rost/fonts.css'
import './rost/tokens.css'
```

## Using a component

- Import it from its folder: `import { Button } from './rost/button/Button'`. Check the file for the exact export.
- Props are on the component's page, in the Props table. Use the values listed there and nothing else.
- Never pass hover, pressed or focus. They come from CSS. Disabled is the only state you set.
- Give everything a name a screen reader can read. An IconButton needs its `label`.
- One `Primary` button per screen.

## Styling

- Colours, spacing, radius, type and motion come from tokens: `var(--spacing-gap-medium)`, `var(--non-interactive-foreground-primary)`. They're all in `src/rost/tokens.css`. Dark and light both come from the same names, so never hard-code a colour.
- If the app isn't green, it has a brand: `data-brand` on `<html>` and a brand file after `tokens.css`. Don't recolour Rost's green by hand; `npx github:Runceanu/rost brand <name> <hex>` makes a brand that keeps every contrast.
- No raw hex, no invented token names. If a value you need has no token, say so and stop to ask.
- Don't edit files in `src/rost/`. The next `add` puts Rost's version back. Layout and placement go in the app's own CSS.
- Rost's stylesheet can load after the app's. If an app rule on a Rost class doesn't take, double the class (`.rost-banner.app-banner`) rather than reaching for `!important`.

## When Rost doesn't have it

First try to make it from Rost's components. Most screens are. If something really is missing, build it in the app with Rost's tokens, keep it small, and say it's a gap so it can go into Rost properly. Don't pull in another UI kit or component library to fill it. Rost stays independent.

## When the app has to differ

If the app needs a component to look or behave differently, don't change the copy quietly. Write it down in the app's contract copy, under `implementations.<app>.deviations`, with a `why`. Ask which key the app uses if you don't know. A difference with a reason is a decision. Without one it's drift, and someone will "fix" it.

If the change would be right for every app, it belongs in Rost's contract instead. Say so rather than patching the copy.

## A page with no build step

A single HTML file, an artifact or a quick prototype can't run the installer. It can still be Rost:

- The tokens are at https://rost.build/tokens.css, dark and light, and the brands at https://rost.build/brands.css. Link them, or paste their contents into a `<style>` when the page can only load its own files.
- A component's CSS and markup are in its registry item, `https://rost.build/r/<id>.json`: the `.css` file is the styles, and the `.tsx` file shows the class names and elements to write by hand. Keep the class names exactly (`rost-button rost-button--type-primary`), so the CSS applies.
- The font is General Sans, from Fontshare. Where a page can only load Google Fonts, leave it out: the tokens fall back to the system's sans-serif.
- Dark is the default. `data-theme="light"` on `<html>` for light, `data-brand` for a brand.

Rost has no claude.ai design system artifact. When a tool looks for "a design system" among artifacts and finds none, this is still the one to use.

## Checking your work

```sh
npx github:Runceanu/rost audit
```

It finds `var(--...)` names that don't exist (they fail silently in CSS), raw hex colours, and token names Rost doesn't know. Undefined names always fail it. `--strict` fails on the other two as well, for an app that's already clean.

If the app has a contract test (most of mine run `conform.ts` in their tests), run the tests too.
