Split button
A main action joined to a menu of the actions next to it. It is a Button group and a Dropdown menu, so it looks and moves as they do.
npx shadcn add https://kinoui.com/r/split-button.jsonCopy install command
Examples
Default
Put a SplitButtonAction and a DropdownMenu holding a SplitButtonTrigger in a SplitButton. loading runs the action and holds both halves.
Remember the last choice
The menu picks what the action does: keep the pick in state, show it on the action, and give the menu a DropdownMenuRadioGroup.
Variants
variant sets both halves at once, and the group draws the line between them in a shade of their colour.
Sizes
size sets both halves at once. The menu’s button stays square, as tall as the action.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/split-button.json- Files
lib/refs.tslib/reduce-motion.tslib/resize.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxlib/run-progress.tslib/highlight.tscomponents/kino/button-group.tsxlib/scroll.tscomponents/kino/separator.tsxlib/popup.tslib/menu.tsxcomponents/kino/dropdown-menu.tsxcomponents/kino/split-button.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
SplitButton
SplitButtonAction
SplitButtonTrigger
Data attributes
Accessibility
- The group has
role="group". Name it witharia-label, so a screen reader says what the action is for. - The menu’s button shows only an icon, so its
aria-labelis required and says what the menu holds. - Each half has its own place in the tab order. The menu opens with Enter, Space or Down arrow, the arrow keys move through it, and Escape closes it and puts focus back on its button.
- While loading, the action keeps focus and is announced as busy, as a loading Button is.
- When the system asks for less motion, the highlight moves straight to the other half and the menu only fades.