Split button
The usual action, with an arrow that opens its variations.
Installation
npm i @uisatin/uiimport { SplitButton } from '@uisatin/ui/split-button'About 46.9 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/split-button.jsonAdds split-button.tsx, button.tsx, button-group.tsx, dropdown.tsx, kbd.tsx, labels.tsx, pointer-modality.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 SplitButton component is an attached ButtonGroup of the main Button and an arrow that opens a DropdownMenu of related actions. It takes every Button prop.
| Prop | Type | Default |
|---|---|---|
menu | ReactNode | — |
variant | "primary""secondary""tertiary""inverse""destructive" | "primary" |
size | "xs""md""lg""xl" | "md" |
shape | "default""rounded" | "default" |
disabled | boolean | false |
menuLabel | string | "More options" |
menuProps | DropdownMenuProps | — |
groupClassName | string | — |
Accessibility
Two buttons in a role="group": the main action, then an arrow named "More options" (menuLabel) that opens a DropdownMenu. disabled disables both.
| Key | Action |
|---|---|
| EnterorSpaceor↓ | On the arrow: opens the menu. |
| ↑or↓ | Moves between the menu items. |
| A–Z | Jumps to the item whose label starts with the typed letters. |
| Esc | Closes the menu and returns focus to the arrow. |
Something wrong or missing on this page?
Report a problemSuggest an improvement