Button Group
Lays out related buttons as one unit. A wrapper only: it works with any Button or Icon Button, and adds no JavaScript.
Install
npx shadcn@latest add @nelumbo/button-groupStandard
Separate buttons that react together: press and hold one and its corners round, without any button changing width.
Connected
A tight row with small inner corners. Selected toggles round out into full pills, so the choice reads from the shape as well as the color.
Usage
<ButtonGroup variant="connected" aria-label="Text alignment"> <IconButton toggle icon="format_align_left" label="Align left" /> <IconButton toggle icon="format_align_center" label="Align center" /></ButtonGroup>Props
| Prop | Type | Default | Notes |
|---|---|---|---|
variant | "standard" | "connected" | "standard" | |
aria-label | string | Name the group when the buttons work as one control |