Search

Search components and flows across the catalog

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.json

2. Use it

Every prop is optional
app/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

  1. A 48px dark slate (#0f172a) button split by a thin divider: the main action on the left, a 44px caret button on the right.
  2. 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.
  3. 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.

More from ThatDesignUI

Image gallery lightbox

Image gallery lightbox

ThatDesignUIOriginalMedia component

Notification center

Notification center

ThatDesignUIOriginalNotifications component

Interactive chart card

Interactive chart card

ThatDesignUIOriginalDashboard component

Multi-select combobox

Multi-select combobox

ThatDesignUIOriginalForms component