Skip to content

Checkbox

Status: stableAccessibility reviewedtenet-ui@0.4.0
Import
import { Checkbox } from 'tenet-ui';

Also accepts every prop of Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>.

Source: src/components/Checkbox/Checkbox.tsx

When to use: an independent on/off choice (or several non-exclusive ones). Use Checkbox with its label, not a raw <input> or a styled toggle <div>.

  • Always pass a label (it is associated to the input automatically); add caption for help text.
  • For a set of mutually exclusive options use RadioGroup, not multiple checkboxes.
  • Control with checked + onChange, or leave uncontrolled with defaultChecked.
  • The tick color comes from the accent token (accent-color) — never restyle it with hardcoded colors.
  • <Checkbox label="Watch this repository" caption="Get notified of all activity." />
  • <div className="checkbox checked" /> — not focusable, not a real input, no label.
3 stories for Checkbox — open in Storybook

The full matrix (all args, controls, accessibility panel) is in Storybook.

PropTypeDefaultDescription
labelReactNodeVisible label rendered next to the box.
captionReactNodeOptional helper text under the label.
invalidbooleanfalseMark the field as invalid (sets aria-invalid).
indeterminatebooleanfalseTri-state "partially checked" visual (mixed); also sets aria-checked="mixed".