When used as a string of related links the buttons can be places within a generic container.
Examples
When used as a navigation bar the buttons should be placed within a list. Same appearance as default.
Examples
Stack buttons at the XS–SM breakpoints while visually keeping them grouped. Same appearance as default at the MD and up breakpoints.
Examples
The reversed style provides the buttons with contrast against dark backgrounds.
Examples
Button sizes can increase or decrease the size of the buttons in the group.
Examples
Usage
Rules
- Use button groups for toolbars or grouping related links instead of placing separate buttons together on a row
Constraints
- Although it‘s entirely possible to use additional button styles, the default button style is the preferred presentation for this pattern (see the Reversed option for an example of how other styles can be applied)
Principle
- In some cases there can be multiple CTAs and rather than going button crazy this pattern allows for multiple items to be grouped together in a cohesive visual representation
- In other cases it is appropriate to create a toolbar of sorts where different controls or options should be grouped
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 - When using the
active
class on a button to represent that the current page or selection is active consider usingaria-current="true"
oraria-current="page"
Class Names
nav Required |
Place on a generic containter (like a |
nav-btns Required |
Use on the same element as |
nav-stack-sm Modifier |
Use on the same element as |
nav-item Required |
When using |
btn Required |
Use on the |
active Modifier |
Use with |
btn-reversed Modifier |
Use with |
btn-lg Modifier |
Add to the |
btn-sm Modifier |
Add to the |
btn-xs Modifier |
Add to the |
- Last updated May 18, 2018
- Not currently authorable
- Core - Nav Buttons