tuix-toggle-button
A switch with the checkbox API and a sliding track.
Loading the components…
States
Loading the components…
Label side
Loading the components…
API
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
checked | checked | boolean | false | On or off |
label | label | string | '' | Label text |
labelSide | labelside | CheckboxLabelSide | right | left or right |
disabled | disabled | boolean | false | Blocks interaction |
dark | dark | boolean | false | Dark palette |
Events
| Event | Detail | When |
|---|---|---|
change | { value: boolean, label?: string } | The user flips the switch |
Typed as CustomEventTuixToggle, the same payload as the checkbox.
Slots
| Slot | Content |
|---|---|
| default | Replaces the label text |
Notes
- There is no
errorstate; a checkbox covers anything that has to be validated. - Like the checkbox, the switch does not own its state: flipping it reports
changeand leavescheckedalone, so the application writes the new value back.