Split Button

A button component that combines a primary action with a dropdown menu for additional actions.

import { SplitButton, MenuItem } from '@cerberus/react'

Usage

The SplitButton component combines a primary action button with a dropdown menu for additional related actions.

It's ideal for situations where you have a primary action that users perform most often, but also want to provide quick access to related secondary actions.

Main Action

The SplitButton accepts all standard button props for the primary action button, allowing you to customize its behavior.

Primitives

The SplitButton component is built using the following primitive components:

ComponentDescription
ButtonGroupGroups the primary button and dropdown trigger together
ButtonThe primary action button
MenuThe dropdown menu container
MenuTriggerThe dropdown trigger (IconButton)
MenuContentThe dropdown menu content container
MenuItemIndividual menu items within the dropdown

API

SplitButton

The SplitButton component accepts the following props:

NameDefaultDescription
childrenMenuItem components to display in the dropdown
actionTextThe text for the primary action button

The SplitButton component internally uses:

Use MenuItem components as children of SplitButton to define the available actions in the dropdown menu. See the Menu documentation for more details on MenuItem props.