Components / Switch

Switch

A control that toggles between on and off: role="switch", keyboard-operable, with a hidden input for form submission. The behaviour comes from the brain; this preview is the real component running in WebAssembly.

Examples

razor
<ZitsSwitch @bind-Checked="_on" id="airplane" />
<ZitsLabel For="airplane">Notifications @(_on ? "on" : "off")</ZitsLabel>

@code { private bool _on = true; }

Installation

Terminal bash
navius add switch

API reference

Prop Type Default
Checked bool false
DefaultChecked bool false
Disabled bool false
Name string? -
Value string "on"
Required bool false