Officina UI
Components

Checkbox

Accessible checkbox with optional label, description, and an indeterminate state.

Checkbox toggles a boolean. Pass checked and onChange to control it, or defaultChecked to leave it uncontrolled; onChange receives the next boolean directly. Provide a label (and optional description) to render the text beside it, fully wired for accessibility. Set indeterminate for the mixed state used by "select all" parents. Built on Headless UI for keyboard and focus handling.

Example

Preview

Works standalone or inside tables and forms.

import { Checkbox } from '@officina/ui';
import { useState } from 'react';

function Example() {
  const [checked, setChecked] = useState(false);
  return (
    <Checkbox
      checked={checked}
      onChange={setChecked}
      label="Subscribe to updates"
      description="One email a week, no spam."
    />
  );
}

API

PropTypeDefaultDescription
checkedboolean—Controlled checked state.
descriptionstring—Secondary helper text under the label.
disabledboolean—Disable interaction and dim the control.
indeterminateboolean—Render the mixed/indeterminate visual state.
invalidboolean—Marks the field invalid for validation styling and `aria-invalid`.
labelstring—Visible label beside the checkbox.
namestring—Form field name, for native form submission / form libraries.
onChange(checked: boolean) => void—Called with the new checked state on toggle.
requiredboolean—Marks the field as required for validation styling and `aria-required`.

On this page