Button
A clear, responsive action with quiet secondary states.
Related actions joined into one surface with hairline dividers: a hover highlight glides between segments, the pressed one answers in place, and an attached menu can close the row.
npx shadcn@latest add @silicon-ui/button-groupnpx shadcn@latest add @silicon-ui/button-groupInstall the dependencies.
npm install @radix-ui/react-dropdown-menu lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/button-group/button-group.tsxcomponents/silicon-ui/button-group/button-group.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
items* | ButtonGroupItem[] | — |
label*Accessible name of the group, such as "Document actions". | string | — |
menuAdds a trailing chevron segment that opens these actions in a menu aligned to the group's edge. | ButtonGroupMenu | — |
variant | ButtonGroupVariant
| "outline" |
size | ButtonGroupSize
| "md" |
orientation | ButtonGroupOrientation
| "horizontal" |
collapseLabelsWhen the row does not fit its container, segments with an icon drop their label and keep the icon. Horizontal only. | boolean | true |
disabledDisables every segment and the menu. | boolean | false |
className | string | — |
style | CSSProperties | — |