Button
A clear, responsive action with quiet secondary states.
Icon buttons in a compact group: the one you point at or focus grows to reveal its label while its neighbours slide aside, and an action confirms in place.
npx shadcn@latest add @silicon-ui/expanding-button-groupnpx shadcn@latest add @silicon-ui/expanding-button-groupInstall the dependencies.
npm install motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/expanding-button-group/expanding-button-group.tsxcomponents/silicon-ui/expanding-button-group/expanding-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* | readonly ExpandingButtonGroupItem[] | — |
label*Accessible name of the toolbar, such as "Message actions". | string | — |
size | ExpandingButtonGroupSize
| "md" |
defaultExpandedId of the action whose label shows at rest, usually the primary one. Defaults to the first enabled action: one action is always expanded. Pointing at or focusing another moves the expansion there, and it returns here when the pointer and focus leave. | string | null | null |
onActionCalled with the item id whenever an action runs, before its own onSelect. | (id: string) => void | — |
confirmDurationHow long the confirmation stays, in milliseconds. | number | 1400 |
className | string | — |
style | CSSProperties | — |