Checkbox
A component to select one or more items from a set of items. It can be in 3 states Checked, Unchecked and Indeterminate.
A checkbox is in indeterminate state when it is neither checked nor unchecked.
Most DOM attributes are supported and also supports 3 sizes - small, medium, large.
To get a handle of the underlying DOM element, use React Refs.
Accessibility
Checkbox is fully accessible by default. You don't necessarily need to add additional ARIA attributes.
- Use tab or shift + tab to navigate between checkboxes
- When focused, press space to check or uncheck
Usage
import Checkbox from "@asphalt-react/checkbox"
;<Checkbox value="yes" label="Are you a human ?" />
Props
size
Size of the Checkbox. accepts s, m, l for small, medium & large
type | required | default |
---|---|---|
enum | false | "m" |
label
Label for the Checkbox
type | required | default |
---|---|---|
string | false | "" |
indeterminate
Set indeterminate status of checkbox
type | required | default |
---|---|---|
bool | false | false |