Meridianby Commenda
Components

Checkbox

A choice people turn on or off.

A choice people turn on or off, alone or in a list. 16 square with radius 4, its label (14) and an optional description built in. On HubSpot forms it carries consent and "send me the guide" choices.

Send me the monthly tax briefunchecked
Send me the monthly tax briefchecked
All productsindeterminate

Usage

Example.tsx
import { Checkbox } from "@commenda/meridian/ui/checkbox";

<Checkbox label="Send me the monthly tax brief" onCheckedChange={setSubscribed} />;

Checked, unchecked, indeterminate

Indeterminate shows a parent when only some of its children are checked. Clicking it checks them all.

Send me the monthly tax briefunchecked
Send me the monthly tax briefchecked
All productsindeterminate

With a description

One line under the label when the choice needs explaining.

I agree to receive emails from CommendaYou can unsubscribe at any time. See our privacy policy.

A group

A parent with its children indented 24, 8 apart. The parent is indeterminate while only some are on. Try it: the parent follows its children.

All products
Sales taxTransfer pricingEntity management

States

Hover darkens the border. Focus is the 2px blue ring with a white gap, from the keyboard only. Disabled keeps its label readable.

Send me a copyunchecked · default
Send me a copyCopies are off for this formdisabled
Send me a copychecked · default
Send me a copyCopies are off for this formdisabled

Hover and Tab to see hover and focus.

Checkbox card

Radio card’s sibling, for choices where several can be picked and each needs a title and a description, like the products someone wants a demo of. The whole card is the click target and carries the focus ring.

Sales taxRegistration, filing and nexus tracking.Transfer pricingPolicies, benchmarking and local files.Entity managementAnnual reports and registered agents.Tax and accountingBookkeeping and corporate returns.Global indirect taxVAT and GST in 100+ countries.PayrollComing soon.Payroll is not available yet

Anatomy

Box 16, radius 4, 1px border soft-pearl 400. Checked and indeterminate fill blue 700 with a white 12 mark. The label is 14 and sits 8 to the right; the description is 14 in soft-pearl 800, 2 below.

API reference

PropTypeDescription
labelRequiredstringFrom Pathfinder.
hideLabelbooleanFrom Pathfinder.
descriptionstringFrom Pathfinder.
disabledReasonstringFrom Pathfinder.
variant"default" | "card"From Pathfinder.
detailsreadonly string[]From Pathfinder.
leadingReactNodeFrom Pathfinder.
classNamestringFrom Pathfinder.
onCheckedChange(checked: boolean) => voidFrom Pathfinder.
defaultCheckedbooleanWhether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead.
styleCSSProperties | ((state: CheckboxRootState) => CSSProperties | undefined)Style applied to the element, or a function that returns a style object based on the component's state.
formstringIdentifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.
disabledbooleanWhether the component should ignore user interaction.
namestringIdentifies the field when a form is submitted.
valuestringThe checkbox's value. Identifies it within a [Checkbox Group](https://base-ui.com/react/components/checkbox-group), falling back to name when omitted. When submitting a form, a checked box submits value; with no value, it submits the native "on".
idstringThe id of the input element.
readOnlybooleanWhether the user should be unable to tick or untick the checkbox.
requiredbooleanWhether the user must tick the checkbox before submitting a form.
inputRef((instance: HTMLInputElement | null) => void | (() => VoidOrUndefinedOnly) | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | RefObject<HTMLInputElement | null>A ref to access the hidden <input> element.
checkedbooleanWhether the checkbox is currently ticked. To render an uncontrolled checkbox, use the defaultChecked prop instead.
indeterminatebooleanWhether the checkbox is in a mixed state: neither ticked, nor unticked.
uncheckedValuestringThe value submitted with the form when the checkbox is unchecked. By default, unchecked checkboxes do not submit any value, matching native checkbox behavior.

Best practices

  • Use a Checkbox for choices that send with the form. For a setting that applies the moment it changes, use a Switch.
  • One Checkbox alone asks a yes or no question. In a list, every box is independent; for one choice from a few, use Radio.
  • Labels say what is turned on ("Send me the monthly tax brief"), never a question ("Do you want the brief?").
  • Marketing consent is never pre-checked. Its label matches the HubSpot subscription type it sets.
  • The label is part of the click target, not just the box.
  • Indeterminate is only for a parent of checkboxes, never a third answer.
  • Source: Pathfinder Checkbox. Meridian sets labels in 14 and descriptions in 14.

On this page