Button

Triggers an action in place — submit, save, confirm, open a dialog.

Stablev0.3.0@garn/ui/button

Default

Default button.

Appearance

Fill / emphasis (Button's named-exception axis). Pair with `tone` for color intent.

Emphasis

Emphasis steps from solid to quiet — `default` for the primary action, `soft` for a common second-tier one, `outline`/`ghost` for tertiary and dense surfaces. Layer `tone` on any of them.

default
soft
outline
ghost

Sizing

Control height rung; `icon-*` sizes are square (icon-only).

xs
sm
md
lg
xl

Spacing

The same control rendered across garn's density modes — compact, default, and spacious.

Compact
Default
Spacious

States

Interactive states, toggled live.

usage
<Button>Button</Button>

State

Tone

Color intent, applied to the default/soft/outline/ghost fills (`link` is tone-inert).

neutral
brand
danger
success
warning

Justify

How the leading/label/trailing run is placed once the button is wider than its content. `between` pushes the slots to the edges (the nav-row / disclosure look); `start` left-aligns the run. No effect at hug width.

center
start
between

FullWidth

Fills the inline axis of the container instead of hugging its content — releasing the base `shrink-0`. Usually paired with `justify`.

true
false

Button with icon

Pair the label with an icon to reinforce meaning, or drop the label entirely for compact actions.

Icon Before

A leading icon clarifies the action; the optical trim keeps it centered.

Icon After

A trailing icon signals direction or progression.

Icon Only

Square `icon-*` sizes — always pass an aria-label.

Icon sizes

icon-xs
icon-sm
icon
icon-lg
icon-xl

Async

Async State

The full lifecycle: paced spinner → check/cross → self-reset via `onStateChange`. Each step is announced.

Form Status

React 19 `useFormStatus` driving `loading` from the enclosing form's pending state.

Label Swap

Width-preserving label swap (“Copy” → “Copied”) — a grid stack, so the button never resizes.

Layout

Full Width

`fullWidth` with each `justify` value — the axis only becomes visible once the button is wider than its content.

Description

The compound shape: a de-emphasized second line that joins the accessible name.

Content

Shortcut Hint

A Kbd hint in the trailing slot, aria-hidden so the accessible name stays the bare verb.

Icon Nudge

A trailing arrow that nudges on hover — motion-safe gated.