Components / Checkbox

Checkbox

A control that allows the user to toggle between checked and not checked: role="checkbox", Space-operable, tri-state aware, with a hidden input for form submission. The behaviour comes from the brain; this preview is the real component running in WebAssembly.

Examples

You can unsubscribe at any time.

razor
<div class="flex items-center gap-3">
    <ZitsCheckbox @bind-Checked="_terms" id="terms" />
    <ZitsLabel For="terms">Accept terms and conditions</ZitsLabel>
</div>

@code { private bool _terms = true; }

Installation

Terminal bash
navius add checkbox

API reference

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