A control that allows the user to toggle between checked and not checked.
Demo
Features
- Full keyboard navigation.
Anatomy
Directives
x-checkbox
Required
The root element for the checkbox.
Modifier | Description |
---|
.checked | Checks the checkbox by default |
Event | Description | detail |
---|
checkbox:change | Whether the checkbox is checked or unchecked. | { checked: boolean } |
Data Attribute | Values |
---|
[data-state] | checked | unchecked |
x-checkbox:indicator
Required
Visual indicator for the checkbox.
Event | Description | detail |
---|
checkbox:change | Whether the checkbox is checked or unchecked. | { checked: boolean } |
Data Attribute | Values |
---|
[data-state] | checked | unchecked |
x-checkbox:label
Required
Text label for the checkbox.
Data Attribute | Values |
---|
[data-state] | checked | unchecked |