Split button

A React component in Beamline's Actions category, in the free sample.

One obvious action joined to a menu of close alternatives; both halves are real buttons and the menu uses the shared menu rows.

Use it for

  • One primary action with a few close variants: Send / Schedule send, Export / Export as CSV.

Not for

  • Unrelated actions (dropdown-menu).
  • More than about six alternatives.

Anatomy

  • main Button (with choices: the chosen way's icon and words)
  • divider (steps back while pointed at)
  • menu Button (its chevron turns while open)
  • menu (choices as one checked set, then actions)

Variants

  • variant: primary, secondary, accent
  • size: sm, md, lg
  • mode: actions (alternatives run at once), choices (the menu picks what the main half does)

States

  • idle
  • loading (menu disabled)
  • disabled
  • menu open (chevron turned)
  • a choice made (the main half changes words; its width follows)

Keyboard

  • Tab reaches each half
  • Enter / ↓ on the menu half opens the menu

Motion

Same as Button and the dropdown menu: a changed main label slides in while the width follows on spring.morph. The menu half's chevron turns over --pui-duration-standard while open; the seam between the halves steps back at once while the button is pointed at.

Props

PropTypeDefaultDescription
labelstring—The main action (with choices, the group's name).
onClick(value?: string) => void—Runs the main action; with choices it receives the chosen value.
actionsMenuItem[]—Close alternatives that run at once: Schedule send, Export as CSV.
choices / value / defaultValue / onValueChange{ value, label, icon? }[] / string / string / (value) => void—choices: Ways the main action can run; the menu picks one (a check marks it) and the main half then says and does that, like a merge button. Any actions follow under a line. value: Controlled value of the chosen action mode; omit to use defaultValue. defaultValue: Initial value of the chosen action mode when uncontrolled. Defaults to the first choice value. onValueChange: Reports value of the chosen action mode after an edit; no callback by default.
variant"primary" | "secondary" | "accent""primary"Visual weight of the control. Defaults to "primary".
loading / disabledboolean—loading: Shows the loading state while data or an operation is pending. Defaults to false. disabled: Prevents interaction with the control. Defaults to false.
classNamesSplitButtonClassNames; menuClassNames:MenuClassNames—Classes for the named visual parts; no part overrides by default.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
iconReactNode—Icon element shown beside the label. Defaults to no leading icon.
choicesSplitButtonChoice[]—Ways the main action can run; the menu picks one (a check marks it) and the main half then says and does that, like a merge button. Any actions follow under a line.
valuestring—Controlled value of the chosen action mode; omit to use defaultValue.
defaultValuestring—Initial value of the chosen action mode when uncontrolled. Defaults to the first choice value.
onValueChange((value: string) => void)—Reports value of the chosen action mode after an edit; no callback by default.
menuLabelstring—The menu button's accessible name. Default "More options for {label}".
sizeButtonSize—Control size within the supported size steps. Defaults to "md".
loadingboolean—Shows the loading state while data or an operation is pending. Defaults to false.
disabledboolean—Prevents interaction with the control. Defaults to false.
classNamestring—Classes on the documented visual root; no override by default.
menuClassNamesMenuClassNames—Classes for the menu component's named parts; no overrides by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.

Built from

Used in

Dependencies

lucide-react

Import

import { SplitButton } from "@beamline/split-button";

Get it

Split button is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Split button is included in the free MIT sample. Get Beamline · Connect your agent

More in Actions

  • Consequence preview: A risky action that shows what it will do before it runs: one headline sentence, what blocks it and what it also reaches as bands, then the rest as cards…
  • Theme switch: The light/dark control: the page changes in one of four transitions starting from the button (reveal, eclipse, split, rise), and the icon turns between…
  • Confirm morph: A destructive action that asks in place: the button morphs into its question, then into working, then into the result with Undo or Retry, without a dialog.
  • Swipe actions: Row actions behind a swipe on touch screens and a two-finger swipe on a trackpad, and at the row's end for pointer and keyboard (a ⋯ menu in a narrow…
  • Hold to confirm: Confirms a costly action by holding instead of clicking: a fill sweeps across while held and drains if let go early; pointer, touch, Space and Enter all…
  • Copy button: Copies a value and confirms in place: the icon becomes a check and the label says Copied; a refused copy says so instead of pretending.
  • Button: The action control: five weights and a brand fill, a buy/sell tone, sm/md/lg and a 44 px touch size, icon-only, a loading state that keeps its size and…

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.