<tyro-ui-switch>

Switch

Toggle component - on/off state, sliding left to right. Supports a label and a disabled variant. Uses two-way [(value)] binding.

States

Off / On / With label
Enable notifications

Disabled

Off disabled / On disabled
Always enabled (locked)

Inputs

Property
Type
Default
Description
[(value)]booleanfalseSwitch state - two-way binding available
[disabled]booleanfalseDisables the switch
[label]string-Text displayed to the right of the switch

Outputs

Event
Payload
Description
(valueChange)booleanEmitted on every state change

Usage

readonly darkMode = signal(false);

<tyro-ui-switch
  [(value)]="darkMode"
  [label]="lang() === 'en' ? 'Dark mode' : 'Mode sombre'">
</tyro-ui-switch>