ebnsina

Split Button

Buttons 13

About

A primary action button paired with a dropdown chevron for related actions, so a toolbar or form only needs one prominent button instead of several.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Split Button to your project and fits it to your theme.

Code

How Split Button is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import SplitButton, { SplitButtonItem } from "@/components/ui/split-button";

export default function SplitButtonDemo() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center p-10">
      <SplitButton
        onClick={() => console.log("Save")}
        menu={
          <>
            <SplitButtonItem onSelect={() => console.log("Save as...")}>
              Save as…
            </SplitButtonItem>
            <SplitButtonItem onSelect={() => console.log("Save a copy")}>
              Save a copy
            </SplitButtonItem>
            <SplitButtonItem
              variant="danger"
              onSelect={() => console.log("Discard changes")}
            >
              Discard changes
            </SplitButtonItem>
          </>
        }
      >
        Save
      </SplitButton>
    </div>
  );
}

Dependencies

More by ebnsina

View all
  • Countdown Timer

    Countdown Timer

    33
  • Video Player

    Video Player

    24
  • Alarm Clock

    Alarm Clock

    22
  • Voice Note

    Voice Note

    18
  • Hourglass Timer

    Hourglass Timer

    16
  • Sortable List

    Sortable List

    16
  • Sign In Auth Card

    Sign In Auth Card

    11
  • Code Block

    Code Block

    10

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Eclipse Button

    Eclipse Button

    44
  • Button Save

    Button Save

    50
  • App Store Button

    App Store Button

    484
  • Base Button

    Base Button

    1