ButtonGroup
Joins Buttons into one bar with shared borders. Mark the active one with a different variant, or use aria-pressed for a toggle group; the hovered, focused and pressed button rises above its neighbours so its border stays whole. Give the group an aria-label that says what the buttons have in common.
orientation="vertical" stacks them, fullWidth stretches the group and shares the space equally, and attached={false} keeps a gap between the buttons.
Props
orientation'horizontal' | 'vertical'Default:'horizontal'Lay the buttons out in a row or a column.
attachedbooleanDefault:trueShare borders between the buttons; false keeps a small gap.
fullWidthbooleanDefault:falseStretch the group and share the space equally.
aria-labelstringWhat the buttons have in common (the group is a role="group").
classNamestringDefault:''Extra classes for the root element.
childrenReactNodeContent.
...restAny other props are passed to the underlying element.
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | 'horizontal' | 'vertical' | 'horizontal' | Lay the buttons out in a row or a column. |
attached | boolean | true | Share borders between the buttons; false keeps a small gap. |
fullWidth | boolean | false | Stretch the group and share the space equally. |
aria-label | string | – | What the buttons have in common (the group is a role="group"). |
className | string | '' | Extra classes for the root element. |
children | ReactNode | – | Content. |
...rest | – | Any other props are passed to the underlying element. |