<cs-button-group>
StableActionsSince 0.1

Button groups combine related buttons into a single visual unit. Use them for toolbars, segmented controls, or any set of actions that belong together.

Left Center Right

Give every button group a label.
It isn’t shown on screen, but assistive devices announce it so people know what the grouped buttons control.

Examples

Orientation

Set the orientation attribute to vertical to stack the buttons instead of placing them side by side.

Top Middle Bottom

Pill

Add the pill attribute to each button to round the group’s outer edges.

Left Center Right

Place a dropdown anywhere in the group to attach a menu of related actions.

Edit More Cut Copy Paste Delete

Split Buttons

Pair a primary button with a dropdown to make a split button. Give the dropdown trigger an accessible label so people using assistive devices know what it opens.

Save Save Save as… Save all

Tooltips

Pair each button with a tooltip to explain what it does on hover and focus.

Left Center Right Align left Align center Align right

Toolbars

Combine several button groups into a toolbar of related action sets. Use icon-only buttons with label for compact controls, and tooltips to name each one.

Undo Redo Bold Italic Underline Align left Align center Align right

Native Buttons

Button groups also work with native <button> elements when Native Styles are included.

API

Importing

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick this component, use one of the following snippets.

npm Self-Hosted React
import '@cruglobal/cornerstone-components/components/button-group/button-group.js';
import './cornerstone/components/button-group/button-group.js';
import CsButtonGroup from '@cruglobal/cornerstone-components/react/button-group/index.js';

Slots

Learn more about using slots.

NameDescription
(default)One or more <cs-button> elements to display in the button group.

Attributes & Properties

Learn more about attributes and properties.

PropertyAttributeDescriptionTypeDefaultReflects
labellabelA label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive devices when interacting with the control and is strongly recommended.string''
orientationorientationThe button group's orientation.'horizontal' | 'vertical''horizontal'Yes