Checkbox

An easily stylable checkbox component.

API reference

Import the component and place its parts the following way:

Anatomy
import { Checkbox } from '@base-ui-components/react/checkbox';

<Checkbox.Root>
  <Checkbox.Indicator />
</Checkbox.Root>

Root

The foundation for building custom-styled checkboxes.

PropTypeDefault
checkedbooleanundefined
classNamestring | (state) => stringundefined
defaultCheckedbooleanfalse
disabledbooleanfalse
indeterminatebooleanfalse
inputRefReact.Refundefined
namestringundefined
onCheckedChange(checked, event) => voidundefined
parentbooleanfalse
readOnlybooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined
requiredbooleanfalse

Indicator

The indicator part of the Checkbox.

PropTypeDefault
classNamestring | (state) => stringundefined
keepMountedbooleanfalse
render| React.ReactElement
| (props, state) => React.ReactElement
undefined