Checkbox

Checkbox is a form control for single and multiple selections.

  • @primer/react@36.27.0
  • Alpha
  • Not reviewed for accessibility

Import

import {Checkbox} from '@primer/react'

Examples

View in Storybook

Props

Checkbox

NameDefaultDescription
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
falseboolean

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