Zephora UI

Navigation

SplitButton

Primary action button with an attached toggle that opens a menu of secondary actions.

Import

import { SplitButton } from "@zephora/react";

Examples

Basic

`onClick` fires the primary action; `onSelect` receives a menu value.

Last: none

Variants and sizes

Both buttons share the Button `variant` and `size` scales.

API

SplitButton props

PropTypeDefaultDescription
childrenReactNodePrimary button label.
onClickMouseEventHandler<HTMLButtonElement>Primary action.
actions *Array<{ label: string; value: string; disabled?: boolean; danger?: boolean }>Entries of the dropdown action menu.
onSelect(value: string) => voidCalled with the picked action's value.
variantButtonVariant"solid"Visual style of both buttons.
size"sm" | "md" | "lg""md"Size of both buttons.
disabledbooleanfalseDisables the primary button and the menu toggle.
placementPlacement"bottom-end"Menu placement relative to the group.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

Keyboard

KeyAction
ArrowDownOn the toggle: opens the menu and focuses the first action.
ArrowDown / ArrowUpMove between enabled actions inside the menu.
Home / EndJump to the first / last enabled action.
Enter / SpacePicks the active action and closes the menu.
Escape / TabCloses the menu and refocuses the toggle.