Skip to content

Search

Start typing to search.


Show all pages

Documentation

controls

Checkbox

A box people tick to turn one option on, alone or as one of several.

CSS onlyPlain classes; no JavaScript in any stack.

Usage

The label wraps the input and its text, so the whole line is clickable.

HTML

Examples

Group

Put related checkboxes in a <fieldset> with a <legend>. ca-field styles both.

Notify me about
HTML

Guidance and accessibility

When to use

  • Use a checkbox for an option that people confirm with a form, such as agreeing to terms or picking several topics.
  • For a setting that applies at once, use a switch.
  • Write the label as the state that is turned on: “Send me a reminder”, not “Don’t send reminders”.

Accessibility

  • It stays a native checkbox, so Space toggles it and screen readers announce its state. The label is connected because it wraps the input.
  • On touch screens the row is at least 44 pixels tall.
  • A group needs a <fieldset> with a <legend>, so the question is read with each option.
  • Explain why an option is unavailable in its label or a hint, as the invoices option does.

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the checkbox component
ClassKindUse it for
ca-checkboxComponentThe <label> around the input and its text; the click and touch target.
ca-checkbox__inputPartA native <input type="checkbox">; the skin sets its size and color.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />