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

Button

Accessibility

Button from @prepared911/ui/button always renders a <button>. Navigation is Link from @prepared911/ui/link. The element semantics do the heavy lifting; your job is to name the button clearly, pick the right element for the interaction, and keep disabled state honest.
What the component handles
  • Native element semantics. <button> for actions. Link is the anchor for navigation.
  • Keyboard activation. Enter and Space activate buttons. Enter activates links.
  • Focus indicators. Visible focus rings meet WCAG contrast on both themes.
  • Disabled state. Applies the native disabled attribute, removing the element from the tab order.
What you must provide
  • Clear label. Visible text describes the outcome ("Create incident", not "Submit").
  • External-link signaling. On Link, set external and newTabLabel. The label is rendered for assistive tech and names the new tab.
  • Accessible name on icon-only buttons. Pass icon and label. The label is visually hidden. Do not render an icon as children with no name.
  • State on toggles. Non-exclusive toggles expose aria-pressed; disclosure triggers expose aria-expanded with aria-controls.
Links vs. buttons
Use Link to navigate and Button to run an action.
Keyboard behavior
  • Tab / Shift+Tab move focus.
  • Enter / Space activate buttons; Enter activates links.
  • Disabled buttons are skipped.
Semantics and roles
  • <button> with type="button" by default, or type="submit" / type="reset" for those actions. There is no html-type enum.
  • Link for navigation. external sets target="_blank" and rel="noopener noreferrer" and requires newTabLabel.
  • aria-pressed on non-exclusive toggle buttons; aria-expanded + aria-controls on disclosure triggers.
Disabled state
Prefer the native disabled attribute; it removes the button from the tab order and announces as "dimmed / disabled". Use aria-disabled="true" only when the control must remain focusable for a future tooltip-driven explanation.
Known caveats
  • Link-styled buttons. A link that performs an action (or a button that navigates) will mislead keyboard and screen-reader users. Match semantics to behavior.
  • Generic labels. "Delete" in a row context is ambiguous. Pair with aria-label that names the target ("Delete incident ABC-123") when the row isn't part of the accessible name.
Previous
Button / API and Development
Next
Button Group / Usage
On this page
What the component handles
What you must provide
Links vs. buttons
Keyboard behavior
Semantics and roles
Disabled state
Known caveats