Skip to content
ComponentsMarkdown

Checkbox

Binary or indeterminate choice control built on Radix Checkbox, paired with CheckboxGroup for <fieldset> + <legend> grouping.

Live example

Sizes (xs to lg)

Every row maintains at least a 24px target height.

Props

PropTypeDefaultDescription
size"xs" | "sm" | "md" | "lg""md"Checkbox box size (--control-icon-*) and minimum clickable row height (--control-height-*).
labelReactNode—Inline label rendered to the right of the control; makes the entire row clickable.
descriptionReactNode—Optional helper text wired into aria-describedby.
checkedboolean | "indeterminate"—Controlled state; "indeterminate" sets aria-checked="mixed" and renders a Minus icon.
disabledbooleanfalseDisables toggling using step 3 background and step 8 text without opacity.

CheckboxGroup props

PropTypeDefaultDescription
labelReactNoderequiredGroup heading rendered inside <legend>.
descriptionReactNode—Helper text wired into aria-describedby on the fieldset.
errorReactNode—Error text rendered with role="alert" and wired to aria-invalid on child checkboxes.
orientation"vertical" | "horizontal""vertical"Layout direction for child checkboxes.
requiredbooleanfalseAppends a required indicator to the group legend.

Sizes and tokens

Tier / RoleTokenValue
xs--control-icon-xs / --control-height-xs16px box · 24px row min-height · radius-xs (2px)
sm--control-icon-sm / --control-height-sm16px box · 32px row min-height · radius-xs (2px)
md--control-icon-md / --control-height-md20px box · 40px row min-height · radius-sm (4px)
lg--control-icon-lg / --control-height-lg24px box · 48px row min-height · radius-sm (4px)
Unchecked / Checked--input / --primary / --primary-foregroundStep 8 border on background · brand step 9 fill with Check or Minus

States

Release targets

Select at least one target.

Code

import { Checkbox, CheckboxGroup } from "@freshgemui/monoplinth";

export function Example() {
  return (
    <CheckboxGroup
      label="Notification channels"
      description="Choose at least one channel."
      required
    >
      <Checkbox name="channels" value="email" label="Email" defaultChecked />
      <Checkbox name="channels" value="sms" label="SMS" />
    </CheckboxGroup>
  );
}

Do and don't

Do: Provide label or aria-label and use CheckboxGroup for related options
Use the built-in label prop for clickable rows, or pass aria-label when rendering a bare checkbox inside a table cell.
Don't: Wrap Checkbox in Field
Field places labels above controls; use Checkbox's inline label prop or CheckboxGroup instead.

Accessibility

  • Clicking anywhere on the Checkbox row (label, description, or gap) toggles the control while keeping <label> scoped so description does not inflate the accessible name.
  • checked="indeterminate" sets aria-checked="mixed" and displays a Minus icon.
  • Space toggles the checkbox; :focus-visible renders a 2px --ring outline with 2px offset.
  • CheckboxGroup renders <fieldset> and <legend>, wiring description and error via aria-describedby and aria-invalid.

Rationale

Sizing the checkbox box to --control-icon-* while keeping the row target height at --control-height-* guarantees every size meets WCAG 2.5.8's 24×24px minimum target without making the box itself oversized.