Skip to main content

Switch API

Properties
NameTypeDefaultDescription
labelstring—Adds a label to the switch.
label-secondarystring—In two-way mode, the second label.
data-idstring—The id of the internal input element.
namestring—The name of the element, used in posted forms.
valuestring—The value of the input element.
checkedboolean—Whether the input is checked.
disabledboolean—Whether the input is interactive.
helperboolean—Shows 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.—