A main key whose label always names the current target, a trigger that unfolds a menu of targets under a leader line, and a detent strip under the key that always shows the target, its node stretching as it travels.
pnpm dlx shadcn@latest add @beautiful-ui-pro/split-buttonNeeds your registry key. Your components.json style picks the Base UI or Radix build: radix-*, new-york and default get Radix, base-* gets Base UI.
The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
Import it and pass your content. The props that matter most are listed next.
"use client";
import { SplitButton } from "@/components/ui/notchset/split-button";
export function DeployButton({ deploy }: { deploy: (target: string) => Promise<void> }) {
return (
<SplitButton
options={[
{ value: "production", label: "Production", meta: "100% traffic", short: "PROD" },
{ value: "canary", label: "Canary", meta: "5% traffic", short: "CANARY" },
]}
onPress={deploy}
/>
);
}options–
{ value, label, meta?, short? }[]The targets.
value / defaultValue / onValueChange–
string / (value) => voidThe current target.
onPress–
(value) => unknownThe main key. Return a Promise and it shows busy, then done.
detent–
booleanThe detent strip under the key. Default true.
menuHeader–
[ReactNode, ReactNode]A line at the top of the menu.
legend–
stringThe legend above the key.
labels–
Partial<SplitButtonLabels>Every word, for other languages.
components/ui/notchset/split-button.tsx
This component is included with Pro.
Try the live preview above. Get Pro to install the source.