Switch API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
label | string | — | Adds a label to the switch. |
label-secondary | string | — | In two-way mode, the second label. |
data-id | string | — | The id of the internal input element. |
name | string | — | The name of the element, used in posted forms. |
value | string | — | The value of the input element. |
checked | boolean | — | Whether the input is checked. |
disabled | boolean | — | Whether the input is interactive. |
helper | boolean | — | Shows a helper tooltip next to the label. |
Events
| Event | Description | Returns | |
|---|---|---|---|
change | Fires on click or keyboard select whenever the checked state changes. | — | |
click | Fires when the input or label is clicked. | — | |