Components / Button
Button
Triggers an action. Four variants share one height, one radius token and one focus ring.
Preview
<button class="btn btn-primary">Primary</button>
<button class="btn btn-secondary">Secondary</button>
<button class="btn btn-outline">Outline</button>
<button class="btn btn-ghost">Ghost</button>Installation
No build step. Link the token file first, then the component styles.
<!-- in <head> -->
<link rel="stylesheet" href="tokens.css">
<link rel="stylesheet" href="style.css">Variants
| Class | Use for | Tokens |
|---|---|---|
.btn-primary | The one main action per view | --accent, --accent-ink |
.btn-secondary | Secondary actions | --bg-3 |
.btn-outline | Neutral actions on busy backgrounds | --line-2 |
.btn-ghost | Toolbar and inline actions | --fg-2 |
.btn-sm | Dense UI (30px tall) | --r-md |
Accessibility
Use a real <button> for actions and <a> for navigation. The focus ring uses --focus; the theme panel recomputes --accent-ink so text on the accent always keeps at least 4.5:1 contrast.
Keep one primary button per view — two primaries compete for attention.
Tokens
Every component reads from the same handful of variables. Change --radius once and all corners follow: --r-sm = radius×0.6, --r-md = ×0.8, --r-xl = ×1.4.


