Hone UI
Components

Checkbox

A box that turns on and off.

Checkbox is a native checkbox input with a drawn box. Pair it with FormControlLabel for visible text. It is a client component and reads components.Checkbox.defaultProps.

import Checkbox from '@hone-ui/react/Checkbox';

Examples

<FormControlLabel control={<Checkbox defaultChecked />} label="Remember me" />
<Checkbox indeterminate color="secondary" size="small" inputProps={{ 'aria-label': 'Select all' }} />

A controlled checkbox reads checked from your state:

<Checkbox
  checked={on}
  onChange={(event, checked) => setOn(checked)}
  inputProps={{ 'aria-label': 'Select row' }}
/>

Props

PropTypeDefaultDescription
checkedbooleannoneMakes it controlled. Pair it with onChange.
defaultCheckedbooleanfalseThe starting state when uncontrolled.
onChange(event, checked) => voidnoneevent is the real change event. checked is event.target.checked.
indeterminatebooleanfalseShows the mixed state.
color'default', 'primary', 'secondary', 'error', 'info', 'success', 'warning''primary'The checked color.
size'small', 'medium''medium'The size.
disabled, required, readOnlybooleanfalsereadOnly stops onChange.
icon, checkedIcon, indeterminateIconReactNodedrawingsReplace the default drawings.
name, value, autoFocusReach the input. value is sent as a string.
idstringnoneGoes on the input. Use slotProps.root.id for the root.
inputRefRefnoneA ref to the input.
slotProps{ root, input }noneinput accepts id, aria-label, aria-labelledby, aria-describedby, name, required and tabIndex (only -1).
inputPropsobjectnoneDeprecated alias of slotProps.input.
disableRipplebooleanfalseTurns off the Material look's ripple.
sx, className, style, refStandard. ref and extra HTML props go to the root label.

Inside a FormControl, disabled follows it and error colors the box. required does not follow it.

Notes

  • slotProps.input accepts only the keys listed above. data-*, className and style are not supported there.
  • No slots prop.
  • The real input covers the control, so test tools can click it directly, with no force.

Accessibility

The input is a real checkbox, and Space toggles it. A bare Checkbox has no name, so wrap it in FormControlLabel or pass inputProps['aria-label']. An aria-label placed directly on Checkbox lands on the root, not the input.

On this page