Split Button

Pro

A primary action button fused to a chevron dropdown of secondary actions — composed from Button, the fused Input Group and Dropdown Menu, not a new control built from scratch.

</>sv-split-button buttondropdownmenuactions
import { SvSplitButtonComponent } from '@styloviz-pro/split-button';

Demo & usage

Basic usage

Pro

Usage example — open the gallery for the full interactive demo.

Pro

An interactive demo for this component lives in the gallery.

Open live demo

More examples

Menu as a bottom sheet on phones

Pro

`sheetOnNarrow` is forwarded to the split button's dropdown menu: below 640px the secondary actions open as a bottom sheet instead of a menu clamped over the button.

Grouped secondary actions

Pro

Danger action, loading primary

Pro

When to use

  • One dominant action with a small set of closely related variants (e.g. "Deploy" plus "Deploy to staging"/"Deploy preview").
  • You want the primary action a single click away, with alternates one click further — not a plain Dropdown Menu where every option carries equal weight.
  • For a set of equally-weighted actions, use a Button Group or a plain Dropdown Menu instead.

Async states

  • loading

Inputs

NameTypeDefaultDescription
labelrequiredstring—Label for the primary action button.
iconstring''Icon-library NAME for a leading icon on the primary action button — e.g. `'plus'`. It is forwarded to `sv-button`'s `icon`, so it takes a library name; a raw SVG `d` string renders no icon at all.
variantButtonVariant'primary'Semantic color/intent, forwarded to both buttons.
btnStyleButtonStyle'solid'Visual treatment, forwarded to both buttons.
sizeButtonSize'md'Size, forwarded to both buttons.
shapeButtonShape'rounded'Corner style, forwarded to both buttons (the fused seam always flattens the touching corners).
disabledbooleanfalseDisables both the primary action and the menu trigger.
loadingbooleanfalseThe primary action is in flight.
loadingBlocksMenubooleanfalseAlso disable the menu trigger while `loading`.
itemsDropdownMenuItem[][]Flat list of secondary-action menu items. Use `groups` for grouped menus.
groupsDropdownMenuGroup[][]Grouped secondary-action menu items. Takes precedence over `items`.
placementDropdownMenuPlacement'bottom-end'Where the menu opens relative to the trigger.
menuAriaLabelstring'More actions'Accessible name for the chevron trigger button.
sheetOnNarrowbooleanfalseBelow 640px, open the menu as a bottom sheet (safe area + virtual keyboard handled) instead of anchoring it to the chevron — forwarded to the dropdown menu's own `sheetOnNarrow`.

Outputs

EventPayload typeDescription
clickedMouseEventEmitted on a click of the primary action button (suppressed while disabled/loading).
itemClickstringEmitted with the id of the clicked secondary-action item.
itemSelectDropdownMenuItemEmitted with the full clicked secondary-action item object.

Customization & theming

  • Shares Button's `variant` / `btnStyle` / `size` / `shape` across both halves via `variant`, `btnStyle`, `size`, `shape`.
  • Flat `items` or `groups` (same shape as Dropdown Menu) via `items` / `groups`, with `placement` for the popup side.
  • `disabled` disables both halves; `loading` shows a loading state on the primary action only — the menu trigger stays interactive so alternates remain reachable mid-operation.
  • Outputs: `clicked` (primary button), `itemClick` (secondary action id) and `itemSelect` (full item object).

Forms integration

  • sv-split-button — Output-driven, not a ControlValueAccessor. An action menu: `(clicked)` for the main action, `(itemSelect)` for the menu items — no value.

Best practices

  • Do: Keep the primary `label` the action users take most often — the menu is for variants, not unrelated commands.
  • Do: Set `menuAriaLabel` to something specific ("More deploy options") when the default "More actions" is ambiguous in context.
  • Don't: Don't bury the only way to do something inside the chevron menu — if there's no dominant action, this isn't the right component.

Accessibility

  • The chevron trigger has its own accessible name via `menuAriaLabel` (default "More actions"), independent of the primary button's `label`.
  • Built on Dropdown Menu, so the popup inherits its `menu`/`menuitem` ARIA roles and full keyboard navigation once opened.

Feedback on Split Button

Spotted a gap in this page, or something that didn't work as described? Comments are GitHub Discussions in the public styloviz/community repo, so posting needs a GitHub account.

Loads giscus.app and GitHub — nothing is fetched until you click.