Button

Frond
Every clickable. Variants: default, outline, ghost, ghostMuted, destructive, destructiveOutline, link.

Usage

The import, then a use to start from. Both copy as they are.

Import
import { Button } from "@/components/ui/button";import { Plus, Settings } from "@/components/icons";
Example
<Button onClick={createSite}>    <Plus />    New site</Button><Button variant="outline">Cancel</Button><Button variant="ghostMuted" size="iconSm" aria-label="Settings">    <Settings /></Button>

When to use

Use it for

  • One default button per view, for the action that moves the person forward. Everything else is outline or ghost.
  • ghostMuted for toolbar icons and secondary actions: muted at rest, full color on hover.
  • destructiveOutline for a destructive action in place; destructive only on the confirm button inside its dialog.
  • loading while the action runs: the spinner sits over the label, so the button keeps its width.
  • size="xs" for a small action after a value, such as Edit or Upgrade: a 12px icon, 4px from its label.
  • asChild around a Link when the button navigates, so it can open in a new tab.

Avoid

  • A raw <button> or a clickable <div>: it misses the focus ring, the press state and dark mode.
  • Two primary buttons side by side. Pick the one that moves the person forward.
  • A link inside running text: use a plain Link.

Accessibility

Checks

  • Icon-only buttons (size="icon" or iconSm) need an aria-label, repeated in a Tooltip for sighted users.
  • Buttons are never narrower than square, and targets stay at least 32px.
  • disabled takes the button out of the tab order: say why nearby, or keep it enabled and explain on click.

API

Read from each component's stories, the same source as COMPONENTS.md, and kept in step by check:design-system.

Button

PropValues
variant"default""destructive""destructiveOutline""outline""ghost""ghostMuted""link"
size"default""xs""sm""lg""icon""iconSm""iconXs"
loadingboolean
disabledboolean
VariantsDefaultOutlineDestructiveDestructiveOutlineGhostLinkSmallExtraSmallLargeWithIconIconOnlyLoadingGhostMutedIconExtraSmallIconSizesDisabledAllVariants

Keep going

Content
Write plainly with sentence case. Follow these guidelines to ensure you do so.
Accessibility
Fern supports accessibility standards out of the box.