Skip to content

Button Group

A container that groups related buttons into a segmented control.

Install

Bash
npx @madeui/cli add button-group

Usage

TSX
import {
  ButtonGroup,
  ButtonGroupSeparator,
  ButtonGroupText,
} from '@/components/ui/button-group';

Composition

TSX
<ButtonGroup>
  <Button />
  <Button />
</ButtonGroup>

Orientation

Split button

Nest a DropdownMenu whose trigger renders as a Button — ButtonGroup fuses the primary action and the trigger into one control.

Text

Filter

Input

API reference

ButtonGroup

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

StyleX has no child selectors, so the group clones its direct children and merges position styles (end radii, collapsed inner borders) through each child’s style prop — children must be components that accept style (every component in this library does). ButtonGroupText renders a muted label segment; ButtonGroupSeparator divides segments of a filled group.

Was this page helpful?