<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
Disabled
Off disabled / On disabled
Inputs
Property | Type | Default | Description |
|---|---|---|---|
[(value)] | boolean | false | Switch state - two-way binding available |
[disabled] | boolean | false | Disables the switch |
[label] | string | - | Text displayed to the right of the switch |
Outputs
Event | Payload | Description |
|---|---|---|
(valueChange) | boolean | Emitted on every state change |
Usage
readonly darkMode = signal(false); <tyro-ui-switch [(value)]="darkMode" [label]="lang() === 'en' ? 'Dark mode' : 'Mode sombre'"> </tyro-ui-switch>