ThatDesignUIOriginalInteractive preview
Split button with menu
A main action joined to a caret that opens a menu of alternatives; picking one makes it the new main action.
- Category
- Buttons
- Platform
- Responsive
Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Default state
Use this component
Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.
FreeReact 18+Tailwind v3.4 or v4No extra packages
1. Add it with the shadcn CLI
npx shadcn@latest add https://www.thatdesignui.com/r/split-button.json2. Use it
Every prop is optionalapp/page.tsx
import SplitButton from "@/components/split-button";
export default function Page() {
return <SplitButton />;
}Prefer to paste it yourself? Open the .
Under the hood
How it’s built
What’s inside
- A 48px dark slate (#0f172a) button split by a thin divider: the main action on the left, a 44px caret button on the right.
- The caret opens a 16rem white menu below, aligned right, with three choices, each a bold label, a grey hint and a dot that is filled for the current choice.
- Running the main action shows a short confirmation line underneath.
How it behaves
- Up/Down/Home/End move through the menu, Enter chooses, Escape closes and returns focus to the caret.
- Clicking outside closes the menu.
- The caret has aria-haspopup and aria-expanded; items are menuitemradio with aria-checked.
- Choosing an item changes the main button's label.



