# Button

Starts an action. One primary per view region.

Import from `@a31labs/rax/button`.

## Usage

```tsx
<Button variant="primary" loading={saving} onClick={save}>Save changes</Button>
<Button variant="ghost">Cancel</Button>

<Button variant="outline" tone="danger">Decline</Button>
<Button variant="outline" tone="warn">Request changes</Button>
<Button variant="primary" tone="ok">Approve</Button>
```

## Rules

Props: `variant` (`primary` | `secondary` default | `outline` | `ghost` | `danger`), `tone` (`accent` default | `ok` | `warn` | `danger`; colours primary and outline buttons), `size` (`default` | `sm`), `loading`, plus native button props (`type` defaults to `button`). Primary is accent fill; secondary is surface with an `edge` outline; ghost has no fill and ink-2 text; danger is danger-soft with a danger outline, solid on hover. Outline is transparent with a 1px edge in the tone and its label in the tone's text colour (`--rax-accent-text`, or the status ink), the soft fill on hover. `tone` adds colour to a decision row: Approve is `primary` + `ok` (ok-ink fill), Request changes `outline` + `warn` (or `primary` + `warn`: warn fill with `--rax-warn-on` text), Decline `outline` + `danger`. Labels always name the action; colour never carries it alone. Weight 600, active state moves 1px down, disabled at 50% opacity. `loading` shows a spinner after 100ms, keeps the width, ignores clicks and sets `aria-busy`. A button with `aria-disabled="true"` looks disabled and also ignores clicks (and form submit) while staying focusable. One primary per view region.

Page: https://rax.a31.at/components/button
