Split Button A split button is a dual-function menu button that offers a default action as well as the possibility of choosing a different action by selecting from a set of alternatives.
import { VSplitButton } from '@vonage/vivid-api-vue' ;
< VSplitButton label= "My Button" indicator-aria-label= "More actions" />
import { registerSplitButton } from '@vonage/vivid-api' ;
registerSplitButton ( 'your-prefix' );
import { registerSplitButton } from '@vonage/vivid-api' ;
registerSplitButton ( 'your-prefix' );
< your-prefix-split-button label= "My Button" indicator-aria-label= "More actions" ></ your-prefix-split-button >
Use the default slot to add content to be openned when clicking the secondary action.
import { ref , onMounted } from 'vue' ;
import { VSplitButton , VMenu , VMenuItem } from '@vonage/vivid-api-vue' ;
const splitButtonRef = ref < InstanceType < typeof VSplitButton > | null >( null );
const menuRef = ref < InstanceType < typeof VMenu > | null >( null );
const menuOpen = ref ( true );
const splitButtonEl = splitButtonRef . value ?. element ;
const menuEl = menuRef . value ?. element ;
if ( menuEl && splitButtonEl ?. indicator ) {
menuEl . anchor = splitButtonEl . indicator ;
function onActionClick () {
alert ( 'clicked on action' );
function onIndicatorClick () {
menuOpen . value = !menuOpen . value ;
if ( menuRef . value ?. element ) {
menuRef . value . element . open = menuOpen . value ;
< VSplitButton ref= "splitButtonRef" appearance= "outlined" label= "A default split button" @action-click= " onActionClick " @indicator-click= " onIndicatorClick " >
< VMenu ref= "menuRef" placement= "bottom-end" :open= " menuOpen " >
< VMenuItem text= "Menu item 1" />
< VMenuItem text= "Menu item 2" />
< vwc-split-button id= "splitButton" appearance= "outlined" label= "A default split button" >
< vwc-menu id= "menu" placement= "bottom-end" open>
< vwc-menu-item text= "Menu item 1" ></ vwc-menu-item >
< vwc-menu-item text= "Menu item 2" ></ vwc-menu-item >
window . onload = function () {
menu . anchor = splitButton . indicator ;
splitButton.addEventListener ( 'action-click' , () => {
alert ( 'clicked on action' );
splitButton.addEventListener ( 'indicator-click' , () => {
Use the icon slot add custom icons. If set, the icon attribute is ignored.
import { VSplitButton , VIcon } from '@vonage/vivid-api-vue' ;
< VSplitButton appearance= "outlined" label= "submit" >
< VIcon name= "check-circle-solid" connotation= "success" />
< vwc-split-button appearance= "outlined" label= "submit" >
< vwc-icon slot= "icon" name= "check-circle-solid" connotation= "success" ></ vwc-icon >
Property Type Default Description appearance 'ghost' | 'filled' | 'outlined' | 'outlined-light'Sets the appearance connotation 'alert' | 'accent' | 'cta' | 'success' | 'announcement'Sets the connotation disabled booleanSets the disabled state indicatorAriaLabel stringAccessible label for the secondary action label stringIndicates the split button's label. shape 'rounded' | 'pill'Sets the shape size 'condensed' | 'normal' | 'expanded' | 'super-condensed'Sets the size splitIndicator stringIcon for the secondary action
Property Type Default Description appearance 'ghost' | 'filled' | 'outlined' | 'outlined-light'Sets the appearance connotation 'alert' | 'accent' | 'cta' | 'success' | 'announcement'Sets the connotation disabled booleanSets the disabled state indicator-aria-label stringAccessible label for the secondary action label stringIndicates the split button's label. shape 'rounded' | 'pill'Sets the shape size 'condensed' | 'normal' | 'expanded' | 'super-condensed'Sets the size split-indicator stringIcon for the secondary action
Name Description default Default slot. icon The preferred way to add an icon to the component.
Name Description default Default slot. icon The preferred way to add an icon to the component.
Name Type Description action-click CustomEvent<undefined>Event emitted when the action button is clicked indicator-click CustomEvent<undefined>Event emitted when the indicator button is clicked
Name Type Description action-click CustomEvent<undefined>Event emitted when the action button is clicked indicator-click CustomEvent<undefined>Event emitted when the indicator button is clicked