Wrap a series of <CButton>
components in <CButtonGroup>
.
role
and provide a label
For assistive technologies (ex. screen readers) to communicate that a series of buttons are grouped, a proper role
attribute has to be provided. For button groups, this should be role="group"
, while toolbars should have a role="toolbar"
.
Besides, groups and toolbars should be provided an understandable label, as most assistive technologies will otherwise not declare them, despite the appearance of the specific role attribute. In the following examples provided here, we apply aria-label
, but options such as aria-labelledby
can also be used.
These classes can also be added to groups of links, as an alternative to the CNav
components.
Combine button-like checkbox and radio toggle buttons into a seamless looking button group.
Checkbox 1Checkbox 2Checkbox 3
Join sets of button groups into button toolbars for more complicated components. Use utility classes as needed to space out groups, buttons, and more.
Feel free to combine input groups with button groups in your toolbars. Similar to the example above, you’ll likely need some utilities through to space items correctly.
Sizing#Alternatively, of implementing button sizing classes to each button in a group, set size
property to all <CButtonGroup>
's, including each one when nesting multiple groups.
Put a <CButtonGroup>
inside another <CButtonGroup>
when you need dropdown menus combined with a series of buttons.
Create a set of buttons that appear vertically stacked rather than horizontally. Split button dropdowns are not supported here.
API#Check out the documentation below for a comprehensive guide to all the props you can use with the components mentioned here.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4