Checkbox
A control that allows the user to toggle between checked and not checked.
Loading...
Features
Features
- Full keyboard navigation.
- Supports indeterminate _state.
- Can be controlled or uncontrolled.
Anatomy
API Reference
Root
RdxCheckboxDirective
Prop | Default | Type |
---|---|---|
checked | false | boolean The controlled checked state of the checkbox. Must be used in conjunction with onCheckedChange. |
indeterminate | false | boolean Defines whether the checkbox is indeterminate. |
disabled | false | boolean Defines whether the checkbox is disabled. |
required | false | boolean |
Data Attribute | Value |
---|---|
[data-state] | "checked" | "unchecked" | "indeterminate" |
[data-disabled] | Present when disabled |
Indicator
RdxCheckboxIndicator
Renders when the checkbox is in a checked or indeterminate state. You can style this element directly, or you can use it as a wrapper to put an icon into, or both.
Data Attribute | Value |
---|---|
[data-state] | "checked" | "unchecked" | "indeterminate" |
[data-disabled] | Present when disabled |
Input
RdxCheckboxInput
Accessibility
Adheres to the tri-_state Checkbox WAI-ARIA design pattern .
Keyboard Interactions
Key | Description |
---|---|
Space | Checks/unchecks the checkbox. |