Solid buttons have three available styles and command the most visual weight. Note that “primary“ and “secondary“ denote styles and not hierarchy. In general, the primary and secondary solid buttons are at the top of the hierarchy when in the context of other buttons. Note: The default style is not currently available for authoring.
Examples
Outline (ghost) buttons provide less visual weight than solid buttons and pair well with them for secondary actions. Note that “primary“ and “secondary“ denote styles and not hierarchy. Outline buttons are at the middle level of button hierarchy.
Examples
Link buttons are for styling a button to look more like a link. They work well as alternate actions in a button action group, e.g. a solid button with “Continue“ for the label pairs well with a link button with “Cancel“ for its label as an alternate action. Link buttons are the lowest level of button hierarchy.
Examples
The reversed style provides the buttons with contrast against dark backgrounds.
Examples
There are four different button sizes that can be applied to any style of button; large, default, small and extra small
Examples
Block-level buttons span the full width of the parent container.
Examples
Buttons with icons have icons either before or after the label.
Examples
Disabled button styles are reserved for actions that cannot be taken within a given context.
Examples
Usage
Rules
- As a general rule, buttons do, links go
- Buttons are generally for the primary actions a user should take on the site like “Join” or “Log In,” while links should generally be used for navigating within the site
- Buttons with equal visual weight (style) should not be placed next to each other as it conflicts with establishing a clear primary action
- Button labels should be actionable—lead with verbs instead of nouns
- Buttons should clearly indicate what will be the result of the action
- Button style, size and placement should be used consistently throughout a site
- Use title-case for button labels
- Do not use different size buttons in the same context, e.g. a large primary button next to a default secondary button
Constraints
- Button labels should be short, between 1–3 words—labels do not wrap
- Text and icons (icon font or SVG) are the only content that can be within a button, text and icons are always one color within the button
- Limit the number of buttons per page. If multiple buttons are used on a page consider using the available classes to visually decrease the weight per heirarchy.
Principle
- Buttons provide users with quick visual emphasis for primary actions
Accessibility
- Button labels should be written in a way that makes it clear what action the user is taking. If additional clarity is needed consider using text within a
.sr-only
<span>
or witharia-label
. - Buttons must have a visible focus state
- When using button classes on
<a>
elements that are used to trigger in-page functionality (like collapsing content), rather than linking to new pages or sections within the current page, these links should be given arole="button"
to appropriately convey their purpose to assistive technologies such as screen readers
Class Names
btn Required |
Apply to the element ( |
btn-primary Modifier |
Add to the |
btn-secondary Modifier |
Add to the |
btn-primary-outline Modifier |
Add to the |
btn-secondary-outline Modifier |
Add to the |
btn-link Modifier |
Add to the |
btn-link-simple Modifier |
Add to the |
btn-reversed Modifier |
Add to the |
btn-reversed-outline Modifier |
Add to the |
btn-lg Modifier |
Add to the |
btn-sm Modifier |
Add to the |
btn-xs Modifier |
Add to the |
btn-block Modifier |
Add to the |
btn-block-sm Modifier |
Add to the |
disabled Modifier |
Add to the |
btn-icon-text Modifier |
When using an icon within a |
- Last updated May 15, 2018
- Authorable - Yes (with the exception of the new default button style)
- Button Styles