Button
Primary, secondary, ghost, danger and link buttons, plus icon-only and disabled states.
Button
Using the button accessibly
Use a button when an action happens in place; reach for accessible markup whenever a control triggers behaviour rather than navigation.
Do
- Use
<button>for actions and<a>for navigation. - Give icon-only buttons a visually-hidden text name.
- Keep a visible
:focus-visiblering and a realdisabledstate.
Don't
- Don't build a button from a
divorspanwithonclick. - Don't remove focus outlines or rely on graying out alone to disable.
- Don't ship an icon-only button with no accessible name.
Build it right
- Inside a form, set
type="button"unless the control submits. - Make standalone targets at least 24 px, aiming for 44 px.
- Use
aria-pressedfor toggle buttons. - Prefer a native
disabledattribute over only visual graying.
The source styles for this component live in assets/css/components/button.css.