Split Button

Split button with a primary action and a chevron that opens a dropdown of secondary actions, including destructive items. The menu matches the button width.

src/registry/ui/split-button.tsx/r/split-button.json

Installation#

bash
npx shadcn@latest add @minidev/split-button

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/split-button.json

Usage#

tsx
import { SplitButton } from "@/components/ui/split-button"

export function Example() {
  return (
    <SplitButton
      label="Save"
      items={[
        { label: "Save draft" },
        { label: "Save and close" },
        { label: "Discard", destructive: true },
      ]}
    />
  )
}

API reference#

SplitButton props
PropTypeDefault
labelReact.ReactNode"Save invoice"
onPrimaryClick() => void-
disabledboolean-
classNamestring-
itemsSplitButtonItem[]SAMPLE_ITEMS

Dependencies#

npm

lucide-react

Examples#

All button components

Learn more