Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Button
  3. Usage

Button

Usage

Overview
Button is the default actionable control for committing tasks: submit a form, confirm a modal, launch an export, acknowledge a callout. Dispatch leans on Secondary as the baseline and elevates a single Primary or Critical action per region so operators always know the safest default. The rule is emphasis discipline—every visual surface has exactly one "most important" action, and everything else is peer-level or lower. Mixing two primaries in one region forces the eye to choose, which is the failure mode buttons are supposed to prevent.
Reset zoom to 100%
When to use
  • Explicit commits: save, apply, acknowledge, confirm, transfer, escalate.
  • Toolbar and footer actions where the click target must be obvious on touch and pointer.
  • Button-styled navigation to a destination operators commit to (opening a takeover workflow, starting a new incident).
When not to use
  • Plain route navigation that should look and behave as a link—use a link style.
  • Destructive bulk operations without a confirmation step—route through Dialog.
  • Icon-only dense actions in toolbars—use Button with an accessible name.
  • Two mutually exclusive modes—use SegmentedControl.
  • A binary setting with a prose label in a form—use Switch.
  • An icon-only two-state control in a toolbar—use IconToggle.
  • Mutually exclusive pressed options in a cluster—use ToggleGroup items (ToggleGroupItem), not Button with toggle.
Intent and variant
intent is ButtonIntent: Neutral (default), Accent, Destructive, Success, Warning. variant is ButtonVariant: Soft (default), Solid, Ghost, Plain.
PairingEmphasisTypical use
Accent SolidOne per regionThe committed happy path
Neutral SoftPeer levelMost actions: cancel, apply, edit, close
Neutral GhostDe-emphasized peerA quieter action beside a Soft button
Destructive SolidDelete, remove, revokeDestructive verbs; always confirmed
PlainLowest emphasisA text-styled action. Navigation is Link, not Plain
Content guidelines
  • Title case labels with active verbs; drop articles ("Add User", not "Add a User"). Localize with formatMessage.
  • Lead icons disambiguate similar labels ("Export CSV" vs. "Export PDF"); trailing icons hint at post-click behavior (opens an external window, reveals a menu).
  • Reserve exclamation and color for the component's type—don't rewrite "Save" as "Save!" to push urgency.
Behavior and states
  • Navigation. Use Link with href. Button does not accept href. variant={ButtonVariant.Plain} is a text-styled action, not a link.
  • Loading. Set loading and loadingLabel. The label stays visible, the button is disabled, and a loader glyph is announced through the loading label.
  • Disabled. Surface why nearby (helper text or tooltip) when it isn't obvious. A disabled button with no rationale is worse than no button at all.
  • Full width. On tablets and dispatch-on-mobile layouts, one accent commit often spans the row; keep peers inline.
  • active vs pressed. active is a momentary marker without aria-pressed. Use pressed / defaultPressed / onPressedChange when the control must stay pressed. Selected paint uses aria-pressed. Do not pass a toggle prop.
Best practices
Do
  • Place the primary action consistently across the product—trailing in modals, upper-right in page headers, bottom-right in drawers. Muscle memory matters during a shift.
  • Elevate only one Primary or Critical per region. Two primaries in the same frame is almost always a design problem wearing two coats.
  • Pair Destructive with explicit copy ("Remove", "Delete permanently")—never rely on color alone.
Don't
  • Use the small size as the only touch target in critical response flows without adequate spacing.
  • Ship a disabled button with no explanation of the precondition. Say why.
  • Stack a Primary next to a Critical in one region; the emphasis escalation is ambiguous.
  • Over-ornament with multiple icons on a single button—one icon, not two.
Accessibility
Buttons surface visible focus rings, accessible names, and disabled states that assistive technology can announce. See Accessibility for the keyboard model, labelled-by patterns, and disabled-state contract.
Related Components
  • Icon button for compact icon-only actions with tooltips.
  • Button group for clustered peer actions.
  • Split button for a primary action with related alternates.
  • Dialog for confirmation framing after a destructive click.
Previous
Breadcrumb / Accessibility
Next
Button / API and Development
On this page
Overview
When to use
When not to use
Intent and variant
Content guidelines
Behavior and states
Best practices
Accessibility
Related Components