Checkbox
Checkbox is a form control for single and multiple selections.
On this page
- @primer/react@36.27.0
- Alpha
- Not reviewed for accessibility
On this page
Import
import {Checkbox} from '@primer/react'
Examples
Props
Checkbox
Name | Default | Description |
---|---|---|
checked | boolean Modifies true/false value of the native checkbox | |
defaultChecked | boolean Checks the input by default in uncontrolled mode | |
disabled | boolean Modifies the native disabled state of the native checkbox | |
indeterminate | false | boolean Applies an indeterminate state to the checkbox |
onChange | (event: React.ChangeEvent) => void A callback function that is triggered when the checked state has been changed | |
validationStatus | 'error' | 'success' Only used to inform ARIA attributes.<br /> Individual checkboxes do not have validation styles. | |
value | string A unique value that is never shown to the user.<br /> Used during form submission and to identify which checkbox inputs are selected. | |
ref | React.RefObject<HTMLInputElement> | |
as | "input" | React.ElementType |
sx | SystemStyleObject |