Skip to content

ButtonGroup

ButtonGroup joins related actions into one compound control. Use it when the actions are peers, such as view modes or adjacent approve/reject decisions.

Code
<ButtonGroup>
<Button variant="outline">Left</Button>
<Button variant="outline">Center</Button>
<Button variant="outline">Right</Button>
</ButtonGroup>
Code
<ButtonGroup>
<Button variant="outline">Approve</Button>
<ButtonGroupSeparator />
<Button variant="outline">Reject</Button>
</ButtonGroup>
Code
<ButtonGroup orientation="vertical">
<Button variant="outline">Summary</Button>
<ButtonGroupSeparator orientation="horizontal" />
<Button variant="outline">Products</Button>
<Button variant="outline">Activity</Button>
</ButtonGroup>
NameType/Description
orientation"horizontal" | "vertical" | null | undefined
NameType/Description
classNamestring | ((state: SeparatorState) => string | undefined) | undefined
CSS class applied to the element, or a function that returns a class based on the component's state.
orientation = "vertical"Orientation | undefined
The orientation of the separator.
ref((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null | undefined
renderReactElement<any, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SeparatorState> | undefined
Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
styleCSSProperties | ((state: SeparatorState) => CSSProperties | undefined) | undefined
Style applied to the element, or a function that returns a style object based on the component's state.