Checkbox

A control that allows the user to toggle between checked and not checked.

Features

  • Supports indeterminate state.
  • Full keyboard navigation.
  • Can be controlled or uncontrolled.

Install the component from your command line.

Import the components and piece the parts together.

Create your styled checkbox component from the primitive parts.

Contains all the parts of a checkbox.

PropTypeDefaultRequired
asenumbutton
defaultCheckedboolean
checkedboolean
onCheckedChangefunction
disabledboolean
requiredboolean
readOnlyboolean
namestring
valuestringon

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.

PropTypeDefaultRequired
asenumspan
forceMountboolean

Adheres to the tri-state Checkbox WAI-ARIA design pattern.

KeyDescription
SpaceChecks/unchecks the checkbox.
EnterChecks/unchecks the checkbox.