Button
SplitButton
A command with a menu of related commands welded to it.
WAI-ARIA tested
Import
main.ts
import { SplitButton } from '@vitral/vue';Basic
Last command: —
Severities and variants
Sizes and states
API
Read from packages/vue/src/components/SplitButton/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| label | string | The main command's text. |
| icon | IconProp | — |
| model | MenuItem[] | The commands in the menu, as for `<Menu>`. |
| dropdownIcon | IconProp | The menu button's icon. Defaults to a chevron. |
| severity | Severity | — |
| variant | 'filled' | 'outlined' | 'text' | — |
| size | Size | — |
| rounded | boolean | — |
| raised | boolean | — |
| fluid | boolean | — |
| disabled | boolean | — |
| loading | boolean | Shows a spinner on the main button and disables it. |
| menuButtonLabel | string | Names the menu button. Defaults to the locale's "More options". |
| placement | OverlayPlacement | — |
| appendTo | string | Where the menu renders: `'body'` (the default), `'self'`, or a selector. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| click | event: MouseEvent | The main button was pressed. |
| show | — | — |
| hide | — | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | The main button's content. |
| icon | — | — |
| dropdownicon | — | — |
| item | (props: { item: MenuItem; label: string | undefined; focused: boolean; disabled: boolean }) | An item of the menu, as `<Menu>`'s `item` slot. |