Skip to main content

Switch API

Properties
NameTypeDefaultDescription
labelstringAdds a label to the switch.
label-secondarystringIn two-way mode, the second label.
data-idstringThe id of the internal input element.
namestringThe name of the element, used in posted forms.
valuestringThe value of the input element.
checkedbooleanWhether the input is checked.
disabledbooleanWhether the input is interactive.
helperbooleanShows a helper tooltip next to the label.
Events
EventDescriptionReturns
changeFires on click or keyboard select whenever the checked state changes.
clickFires when the input or label is clicked.