Components
Checkboxes
Checkboxes
Square boolean checkbox, backed by a real input so it round-trips through ASP.NET model binding without JavaScript.
Canonical
Use for compact boolean choices, especially inside dense tables where a switch is too heavy. The hidden false-default pattern is handled internally.
States
3 statesOff
On
Disabled
Props
9 attributes| Attribute | Values | Notes |
|---|---|---|
| for | ModelExpression? | Property-bound checkboxes. Mutually exclusive with name. |
| name | string? | Form field name for dynamic-name checkboxes. Pair with checked. |
| checked | bool | Initial checked state when using name. |
| value | string | Checkbox value. Defaults to "true"; set for multi-select patterns. |
| label | string? | Optional inline label rendered next to the checkbox. |
| aria-label | string? | Accessible label for icon-only or table-cell checkboxes. |
| disabled | bool | Renders a disabled checkbox and skips the hidden false-default input. |
| x-model / x-on:change | string? | Optional Alpine bindings for local state or auto-submit flows. |
Do & don't
Do
Use checkboxes for compact repeated boolean controls in tables and matrices.
Don't
Don't use a checkbox for mutually-exclusive choices. Use a radio group or segmented control.