Checkbox

January 22, 2026 ยท View on GitHub

A customizable checkbox input component with support for checked, indeterminate, disabled, and error states.

Usage

import { Checkbox } from "@docspace/ui-kit/components/checkbox";

Basic usage:

<Checkbox
  id="basic-checkbox"
  name="basic"
  value="value"
  label="Basic Checkbox"
  isChecked={false}
  onChange={(e) => console.log(e.target.checked)}
/>

With indeterminate state:

<Checkbox
  label="Indeterminate Checkbox"
  isIndeterminate
  onChange={handleChange}
/>

With error state:

<Checkbox
  label="Checkbox with Error"
  hasError
  onChange={handleChange}
/>

With help button:

<Checkbox
  label="Checkbox with Help"
  helpButton={<InfoIcon />}
  onChange={handleChange}
/>

Disabled states:

<Checkbox
  label="Disabled Checkbox"
  isDisabled
/>

<Checkbox
  label="Disabled Checked"
  isDisabled
  isChecked
/>

<Checkbox
  label="Disabled Indeterminate"
  isDisabled
  isIndeterminate
/>

Properties

PropsTypeRequiredDefaultDescription
idstring--HTML id attribute for the label element
classNamestring--Additional CSS class for styling
styleCSSProperties--Additional inline styles
namestring--HTML name attribute for the input element
valuestring | number | string[]--Value associated with the checkbox
labelstring--Text label displayed next to the checkbox
titlestring--Tooltip text shown on hover
truncateboolean-falseWhether to truncate the label text if it overflows
tabIndexnumber--1Tab order of the checkbox
isCheckedboolean-falseControls the checked state of the checkbox
isIndeterminateboolean-falseShows a rectangle instead of a checkmark when true
isDisabledboolean-falseDisables the checkbox input
hasErrorboolean-falseDisplays the checkbox in an error state
helpButtonReactNode--Custom help button element to display next to the checkbox
onChangefunction--Callback fired when the checkbox state changes
dataTestIdstring--Test id for the checkbox