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

PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalseOn or off
labellabelstring''Label text
labelSidelabelsideCheckboxLabelSiderightleft or right
disableddisabledbooleanfalseBlocks interaction
darkdarkbooleanfalseDark palette

Events

EventDetailWhen
change{ value: boolean, label?: string }The user flips the switch

Typed as CustomEventTuixToggle, the same payload as the checkbox.

Slots

SlotContent
defaultReplaces the label text

Notes

  • There is no error state; a checkbox covers anything that has to be validated.
  • Like the checkbox, the switch does not own its state: flipping it reports change and leaves checked alone, so the application writes the new value back.

On this page