Floating button group
Separate soft buttons in a quiet tray, with one shared highlight that morphs from button to button as you move, and a pressed state that settles in place.
npx shadcn@latest add @silicon-ui/floating-button-groupInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/floating-button-groupManually
Install the dependencies
npm install @radix-ui/react-tooltip motionCopy these files into your project
- components/silicon-ui/floating-button-group/floating-button-group.tsx
- components/silicon-ui/floating-button-group/floating-button-group.module.css
Shared with other components. Skip any you already have.
- components/silicon-ui/tooltip/tooltip.tsx
- components/silicon-ui/tooltip/tooltip.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
items* | readonly FloatingButtonGroupItem[] | — |
label*Accessible name of the toolbar, such as "Board actions". | string | — |
variantmuted sits quietly on a page; floating raises the tray with the floating shadow for overlays such as a selection toolbar. | FloatingButtonGroupVariant
| "muted" |
size | FloatingButtonGroupSize
| "md" |
orientation | FloatingButtonGroupOrientation
| "horizontal" |
iconOnlyShows every item as an icon only, with its label in a tooltip. Items with their own iconOnly win. | boolean | false |
tooltipSideSide of the item tooltips. Defaults to top for a row and right for a column. | "top" | "bottom" | "left" | "right" | — |
onActionCalled with the item id after the item's own onSelect. | (id: string) => void | — |
className | string | — |
style | CSSProperties | — |