Checkbox API

API reference docs for theCheckboxcomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropTypeDescriptionDefault
labelReactNodeLabel for the checkbox describing its purpose._
isDisabled?booleanDisables the checkbox, making it non-interactive and visually styled as disabled.false
size?'standard'| 'large'The size of the checkbox.standard
value?stringDefines the value of the checkbox input, used when submitting a form._
checked?booleanIndicates whether the checkbox is checked, used in controlled components._
id?stringA unique ID for the checkbox._
name?booleanThe name attribute of the checkbox, useful for grouping in forms._
description?ReactNodeDescription text displayed alongside the checkbox, providing additional context._
errorMessage?ReactNodeMessage shown when the field is invalid, styled for error state and announced to screen-readers as invalid._
aria-describedby?stringDefines the ID of the element that provides additional information about the checkbox for accessibility purposes._
onBlur?functionFunction called when the checkbox loses focus._
onClick?functionFunction called when the checkbox is clicked._
onChange?functionFunction called when the checkbox’s value changes._
indeterminate?booleanIndicates whether checkbox in an indeterminate state or not. Designed for scenarios like header groups where some, but not all, options are selected.false
checkboxPositionstart | endPlacement of the checkbox relative to the label. 'start' or 'end'.start

Note: For id and aria-describedby, if a value is provided, the IDs will be merged. Otherwise, React.useId will be used to generate unique IDs to associate the labels appropriately.