Skip to content
Buttons

Split Button

Primary action fused to a dropdown of secondary actions.

Import

tsx
import { SplitButton } from "@cooud-ui/ui";
bash
npx cooud-ui add split-button

Examples

API Reference

Generated from the component's exported types.

SplitButtonProps

Extends Omit<HTMLAttributes<HTMLDivElement>, "onClick">

PropTypeDefaultDescription
children*
ReactNodeThe primary action's label.
onClick
MouseEventHandler<HTMLButtonElement>Fires when the primary (left) segment is clicked.
icon
ReactNodeOptional leading icon for the primary segment (replaced by a spinner while `loading`).
items
SplitButtonItem[]Declarative secondary actions. Ignored when a custom `menu` slot is supplied.
menu
ReactNodeEscape hatch for fully custom menu content (compose `DropdownMenuItem`, `DropdownMenuSeparator`, `DropdownMenuLabel`, …). Takes precedence over `items`.
variant
SplitButtonVariant"primary"Visual style, shared by both segments — mirrors `Button`'s variants.
size
SplitButtonSize"md"Control height/density, shared by both segments.
disabled
booleanfalseDisables both segments.
loading
booleanfalseShows a spinner in the primary segment and disables the control.
menuLabel
string"More actions"Accessible name for the icon-only menu trigger.
align
"start" | "center" | "end""end"Horizontal alignment of the menu relative to the trigger.
sideOffset
number6Gap in px between the trigger and the opened menu.
contentClassName
stringClass applied to the dropdown menu surface.
defaultOpen
booleanUncontrolled initial open state of the menu.
open
booleanControlled open state of the menu.
onOpenChange
(open: boolean) => voidNotified whenever the menu opens or closes.