Checkbox
A boolean that takes effect when the form is submitted.
Default
Checked, unchecked and disabled. The check mark survives reduced motion.
Usage
import { Checkbox } from '@oceanic-hub/brand-system'Checkbox for a change that is saved later, Switch for a change that applies the
moment it is flipped. Getting this backwards is the most common form bug in a settings
screen: a switch that silently needs a Save button.
Pair it with Field's FieldContent (title + description) rather than a bare Label the
moment the option needs a sentence, not just a word; a FieldSet + FieldLegend turns a run
of related checkboxes into one announced group instead of several loose ones. Several
independent booleans is a run of checkboxes; exactly one answer from a visible set is a
RadioGroup, where the group holds the value and an item cannot be checked on its own.
checked takes three values, not two: true, false and 'indeterminate', which paints
the brand fill and swaps the tick for a dash. It reads as "some of the children" and belongs on a
parent that summarises a set — derive it from the set rather than storing it, or the dash can
disagree with what it is summarising. defaultChecked takes the same third value, so a
checkbox that starts mixed and is never controlled draws the dash too: the glyph is chosen from
the state the box is actually in rather than from the prop, so the fill and the mark cannot
disagree on either path (@OCE-1883). Switch is the neighbour with no third value, and its
note says why.
Invalid is a solid stuck border, and it is stated twice. aria-invalid on the checkbox
paints it — that is the attribute assistive technology already reads — and a Field marked
data-invalid paints it too. It outranks the checked and indeterminate borders, so a box that is
both wrong and ticked still shows which (@OCE-1877). Neither line is the whole message:
FieldError carries the sentence, in ink beside a stuck mark. The section below is upstream's
own Invalid State example, which this page refused in writing until the field family's invalid
treatment reached a control whose root is a button.
Two upstream examples are answered here rather than left silent. Upstream's Table example — a header checkbox
selecting every row — is composition over Table, whose TableHead already reserves the
cell (:has([role=checkbox])) and whose TableRow takes selected; DataTable reaches
the same shape through a leading column, on its own page. Upstream's Disabled example is the
package-wide 40% fade and is already the third box in the lead demo above, so a section of its
own would only repeat it.
In a field
Reach for FieldContent with a FieldTitle and FieldDescription the moment the option needs a sentence to be understood, not just a word next to the box.
Group
A FieldSet with a FieldLegend is how a run of related checkboxes becomes one announced group instead of several loose controls that happen to sit near each other.
Indeterminate
checked takes a third value beyond true and false. indeterminate paints the same brand fill as checked and swaps the tick for a dash, and it means "some of the children", never "we do not know" — which is why a parent that summarises a set is the only place it belongs.
Invalid
aria-invalid on the box turns its border solid stuck, and the Field around it says the same thing with data-invalid — either alone is enough to draw the line, and only FieldError can say what is actually wrong.
API Reference
See the Checkbox API page for every prop of every part, with types, defaults and the contract that pins them.
Chart
The chrome around a recharts chart — container, config, tooltip and legend — so a series is named and coloured once, in the same roles as every pill on the screen.
Collapsible
Pure disclosure mechanism — one trigger, one panel, no surface of its own, so every visible choice belongs to the caller.