Put the main action, its arrow, and the menu in SplitButton. A SplitButtonOption pick becomes the main action; a plain MenuItem runs once.
merge-button.tsx
SplitButton
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| variant | "default""outline""secondary" | "default" | The look of both parts. Default default. |
| tone | "destructive" | — | destructive: the soft red look of a risky action (Delete 3 files). Wins over variant. |
| size | "default""lg""sm""xs" | "default" | The row size of both parts. Default default (32px). |
| value | string | — | The main action now: the value of the SplitButtonOption that the last pick made the main one. The app saves it (per user, per page) to remember the last pick. |
| default | string | — | |
| on | — | ||
| open | boolean | — | The menu is open (controlled), with defaultOpen and onOpenChange. |
| default | boolean | false | |
| on | — | ||
| on | — | Runs on a press of the action, with the main value. A promise shows the action busy (spinner, no second run, the arrow off), then done for 1.2 s; a rejection shows an error Toast. | |
| labels | — | ||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SplitButtonAction
<button>| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
| class | string | — | |||||
| glass | "clear""dark""light" | — | |||||
| rounded | "default""full" | — | |||||
| children | — | The words of the main action. A function gets the main value and the status, so the label can follow the last pick and say "Publishing" and "Published". | |||||
From Base UIButtonBase UI docs | |||||||
| focusable | boolean | false | Whether the button should be focusable when disabled. | ||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |||||
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |||||
| |||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||
SplitButtonTrigger
<button>| Prop | Type | Default | Description | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| aria-label | string | — | Defines a string value that labels the current element. Name the menu: "More ways to publish". The arrow has no text of its own. | |||||||||||||||||||||||
| class | string | — | ||||||||||||||||||||||||
| children | ReactNode | — | ||||||||||||||||||||||||
From Base UIMenu.TriggerBase UI docs | ||||||||||||||||||||||||||
| disabled | boolean | false | Whether the component should ignore user interaction. | |||||||||||||||||||||||
| handle | MenuHandle<unknown> | — | A handle to associate the trigger with a menu. | |||||||||||||||||||||||
| payload | unknown | — | A payload to pass to the menu when it is opened. | |||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | |||||||||||||||||||||||
SplitButtonContent
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | — | Show an arrow that points at the trigger. The gap grows from 4px to 8px. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | boolean | — | Put a clear layer under the popup (Base UI Menu.Backdrop), for example to dim it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backdrop | PopupPartProps<MenuBackdropProps> | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<MenuArrowProps> | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UIMenu.PopupBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| children | ReactNode | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| id | string | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| final | — | Determines the element to focus when the menu is closed. - false: Do not move focus. - true: Move focus based on the default behavior (trigger or previously focused element). - RefObject: Move focus to the ref element. - function: Called with the interaction type (mouse, touch, pen, or keyboard). Return an element to focus, true to use the default behavior, or false/undefined to do nothing. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SplitButtonOptions
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UIMenu.RadioGroupBase UI docs | |||
| children | ReactNode | — | The content of the component. |
| default | any | — | The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead. |
| disabled | boolean | false | Whether the component should ignore user interaction. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
SplitButtonOption
<div>| Prop | Type | Default | Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||
| value | string | — | |||||||||||||||||||||||||||
From Base UIMenu.RadioItemBase UI docs | |||||||||||||||||||||||||||||
| on | — | The click handler for the menu item. | |||||||||||||||||||||||||||
| disabled | boolean | false | Whether the component should ignore user interaction. | ||||||||||||||||||||||||||
| label | string | — | Overrides the text used for keyboard text navigation and filtering. Falls back to the rendered text when not provided. | ||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | ||||||||||||||||||||||||||
SplitButtonOptionLabel
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
SplitButtonOptionDescription
<span>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <span> attributes | — | Every other attribute goes to the <span>, with a ref. |
| Tab | Moves focus from the action to the arrow: the group has two tab stops. |
|---|---|
| EnterorSpace | On the action: runs it. On the arrow: opens the menu. |
| AltArrowDown | On the action or the arrow: opens the menu. |
| ArrowUporArrowDownorHomeorEnd | In the menu: moves between the items. |
| Escape | Closes the menu and moves focus back to the arrow. |
Built with
Installs with Split Button
- Components
- Button,Button Group,Collapsible,Menu







