Button group
Buttons that belong together, joined into one block or spaced as a toolbar.
Installation
npm i @uisatin/uiimport { ButtonGroup } from '@uisatin/ui/button-group'About 11.2 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.
npx shadcn@latest add https://uisatin.dev/r/button-group.jsonAdds button-group.tsx, button.tsx, labels.tsx and spinner.tsx to components/ui.
First time with Satin? Set it up once, styles and fonts included, with the installation guide.
API Reference
The ButtonGroup component is a div with role="group" that joins the Buttons inside into one block and hands them a variant, size and shape. ButtonGroupSeparator divides a loose group.
| Prop | Type | Default |
|---|---|---|
orientation | "horizontal""vertical" | "horizontal" |
attached | boolean | true |
variant | "primary""secondary""tertiary""inverse""destructive" | — |
size | "xs""md""lg""xl" | — |
shape | "default""rounded" | — |
aria-label | string | — |
className | string | — |
ref | Ref<HTMLDivElement> | — |
...props | ComponentProps<'div'>Other attributes go to <div> | — |
Accessibility
A div with role="group"; give it an aria-label that says what the buttons are for ("Text alignment"). Each button stays its own tab stop. ButtonGroupSeparator is a vertical separator.
Something wrong or missing on this page?
Report a problemSuggest an improvement