Buttons
Button is a common action that can be easily performed with one click or tap.
At risk for deprecation
Small and large buttons are being considered for deprecation from Anatomy. Please consider using the standard size.
Types
Primary
Primary buttons are the most important actions to which we want to draw users’ attention.
Secondary
Secondary buttons are good for actions that require less emphasis but still require users’ attention.
Tertiary
Tertiary buttons represent less important actions a user can take.
Sizes
Standard
Small
Large
Usage
Primary buttons are used to highlight the most important action in a view or experience.
Secondary buttons are used for offering non-primary actions to users (i.e. Cancel, Reset Filters, etc.)
Though similar in style, tertiary buttons are different than text links in that they typically represent actions with button-like labels. Text links, on the other hand, are typically links to additional content and found in a sentence.
Wide tertiary button is most often used in card footers.
Visual style
Focus states utilize the browser default focus.
Horizontal button groups should be center aligned or right aligned. Consider the situation and assess which alignment makes the most sense.
Stacked button groups can be left aligned or center aligned. Like horizontal button groups, this should be situationally determined.
Editorial
- Use Title Case for all primary and secondary buttons
- Tertiary buttons should be sentence case, unless they are grouped with a primary and/or secondary button, where they should be Title Case
- Lead with a verb
- Limit to 1 – 4 words (~16 characters)
- Add specificity with purpose
- e.g. if a member is in a physician search flow with no headers or float labels to reinforce that’s what they’re searching for, a “Search Physicians” button is more purposeful than a simple “Search”
- Use simple global commands when possible: Save, Back, Next, Apply, etc.
Accessibility
Characteristics
- Performs an action when activated
- May contain text and/or images
Keyboard/Focus Expectations
- Receives Tab Focus: Yes
- Disabled buttons may also receive tab focus
- Activation: Enter or Spacebar
- Watch State Behavior: Focus shifts to spinner and remains until action is performed or error message is displayed
Screen Reader Expectations
- Name: A clear, unique label indicating purpose of the button
- Ex: “Assign Physician, button.”
- Role: Indicates that the element is a button
- Ex: “Assign Physician, button.”
- State (if applicable): The state of a button, such as disabled, or in a watch state.
- Ex: “Assign Physician, button, disabled.”
- Ex: “Assign Physician, button, assigning physician.”
- Description (if applicable): Additional descriptive text for the button.
- Ex: “Assign Physician, button, Assigning a physician will replace any previously assigned physician.”