Split Button
A main action with a menu of alternatives.
MarkdownExamples
With a menu
Pass the menu's trigger attrs to trigger-attrs.
API
| Prop | Type | Default |
|---|---|---|
menuLabel*Accessible name for the toggle half, e.g. "More save options". | string | โ |
triggerAttrsThe | Record<string, unknown> | โ |
variantStyle hook, exposed as | "danger" | "ghost" | "primary" | "secondary" | "solid" | "secondary" |
sizeSize hook, exposed as | "medium" | "small" | "medium" |
disabledDisables both halves. | boolean | false |
| Event | Payload |
|---|---|
actionThe main half was pressed. | [] |
toggleThe toggle half was pressed. | [] |
| Slot | Props |
|---|---|
defaultMain action label. | โ |
caretReplaces the toggle's chevron. | { open: boolean; } |
Styling
- Parts
split-buttonbutton-label- States
data-split-variantdata-split-partdata-split-open
Accessibility
- Name the toggle with
menu-label.