Skip to content

BaseSwitchButton ​

accessible tab switch buttons

Props ​

Prop nameDescriptionTypeValuesDefault
disabledset true if the buttons should be visible but disabled, so they
will appear greyed out and not be clickable
boolean-false
iconPositionspecify where the icon should be renderedstringright, left'right'
iconSizespecify icon size
this prop currently only applies to type 'prominent'
stringsmall, medium, large'medium'
labelset a label for the switches, not visible per default (set showLabel to true if label should be shown) but required for accessibilitystring-
modelValueset the currently active tab (specify the value of the object not the label)string-
optionsspecify the tabs as array of object with value, label and (optional) icon propertiesarray-[{ label: 'tab', value: 'tab', icon: '' }]
showButtonsLabeldefine if the label of the single buttons should be shown (or just icons). This
property is default undefined and is determined internally individually for each type:
normal: default is true
prominent: default is false
boolean-undefined
showLabelset if the switch label is shownboolean-false
typeset a type for the button's active state rendering style
normal: gives the switch a more subtle, more condensed look with active item only indicated by grey border,
buttons have a label per default (showButtonsLabel is true).
prominent: larger buttons with more spacing and permanent border around each item, active item is
indicated by a 2px (app-)colored bottom border, button labels are not shown per default (showButtonsLabel is false)
so the property icon should be set for each switch item in options.
stringnormal, prominent'normal'

Events ​

Event namePropertiesDescription
update:model-valueundefined string - the value of the selected option objectEvent emitted on options switch, value of options object is emitted

Slots ​

NameDescriptionBindings
right-of-contentslot to display something right of text (e.g. icon), or if showButtonsLabel false - generally right of the button contentvalue string - the value of the option object

Demo ​

Type: normal ​

Type normal gives the switch a more subtle, more condensed look with active item only indicated by grey border, buttons have a label per default (showButtonsLabel is true).

Type: prominent ​

Type prominent has larger buttons with more spacing and permanent border around each item, active item is indicated by a 2px (app-)colored bottom border, button labels are not shown per default (showButtonsLabel is false) so the property icon should be set for each switch item in options.