Split Button

An outline button joined to a chevron that opens more options, split by an inset seam. Each half hovers, presses and takes focus on its own; the chevron stays shaded while its menu is open.

BetaReady to use. Its API can still change in a minor release; the changelog says when.

import { SplitButton, SplitButtonAction, SplitButtonMenu } from "@leap-crm/design-system";

Playground

Change a prop and the component follows. Its code is under Props.

Props

size
disabled

Best practices

When to use it, and the rules that apply in particular places.

GuidancePractice
DoPut the common action in SplitButtonAction and its variants in the menu, like Add with more ways to add, so the usual case is one click.
DoPass SplitButtonMenu to a menu trigger's render, so the menu opens from the chevron and the chevron stays shaded while it is open.
DoName both parts: aria-label on SplitButton for the pair, like Add, and on SplitButtonMenu for what the chevron offers, like More ways to add.
DoSize it as you would a Button beside it: md by default, sm in toolbars and columns, xs in dense rows like the conflict check. In an ActionRow it takes the row's size.
Don'tStretch it to fill a container. Like a Button it is as wide as its label; in a narrow column put it in an ActionRow, which shares the width.
Don'tUse it when the menu holds unrelated actions or no option is more common than the rest. Use a DropdownMenu opened from a Button or IconButton.

Props

SplitButtonAction takes Button's props (icon, loading, onClick, disabled). SplitButtonMenu takes Button's props too: pass it to a menu trigger's render.

SplitButton

PropTypeDefaultDescription
sizeButtonSize—Button's sizes: xs 28 · sm 32 · md 36 (the default) · lg 40. Inside an ActionRow it takes the row's.
aria-labelstring—Names the pair for screen readers, like "Add".
children *ReactNode—What it shows inside.
classNamestring—Classes added to the root element, merged with its own. Tokens only.

SplitButtonAction

No props of its own.

SplitButtonMenu

PropTypeDefaultDescription
aria-label *string—What the chevron offers, like "More ways to add".

Code

What the playground shows, ready to copy.

import {
  SplitButton,
  SplitButtonAction,
  SplitButtonMenu,
} from "@leap-crm/design-system";

<SplitButton aria-label="Add">
  <SplitButtonAction>Add</SplitButtonAction>
  <SplitButtonMenu aria-label="More ways to add" />
</SplitButton>

Sizes

Button's heights: lg 40, md 36 (the default), sm 32, xs 28. The chevron half is 4 px narrower than the height, so xs keeps a 24 px target.

lg
md
sm
xs

Open

While its menu is open the chevron half keeps the hover shade. A menu trigger sets aria-expanded on it.

What the examples share

The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.

import { MessageSquarePlus, PhoneCall, Plus } from "lucide-react";

import { Fragment } from "react";

import { SplitButton, SplitButtonAction, SplitButtonMenu } from "@leap-crm/design-system";

const sizes = ["lg", "md", "sm", "xs"] as const;

Keyboard

The keys it answers to. Tab moves between components, arrows move within them.

KeysWhat they do
TabMoves from the main button to the chevron: each half takes focus on its own.
EnterSpacePress the focused half.