For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/en/components/checkbox.md.

Checkbox

Checkbox lets people select zero, one, or several non-exclusive options. Use it for choices that are submitted with a form; use Switch for a binary setting that takes effect immediately.

Notification channels
Receive release status

Select the channels that should notify the team.

Send a summary when a release succeeds or fails.

Notify only while this device is online.

This workspace has no text-message provider configured.

Usage

Import Tailwind and the complete A3S style bundle:

@import "tailwindcss";
@import "@a3s-lab/ui/a3s.css";

Add the input class to a native checkbox and associate it with a label. A single input can pair directly with its label.

<div class="field" data-orientation="horizontal">
  <input class="input" type="checkbox" id="include-logs" name="include-logs" />
  <label for="include-logs">Include diagnostic logs</label>
</div>

For component-level loading, import the base styles, Checkbox structure, Field structure, and the A3S visual style in that order. See Installation for CDN and other integrations.

@import "@a3s-lab/ui/base.css";
@import "@a3s-lab/ui/components/checkbox.css";
@import "@a3s-lab/ui/components/field.css";
@import "@a3s-lab/ui/styles/a3s.css";

Parameters

ParameterValuePurpose
Root<input type="checkbox">Preserves native form, keyboard, and accessibility semantics
classinputApplies Checkbox structure and visual styles
checkedBoolean attributeMarks the option selected; on server-rendered pages, use it only for the real default
disabledBoolean attributePrevents interaction; also add data-disabled to the owning .field
aria-invalidtrueExposes a failed validation state
aria-describedbyElement IDAssociates help, constraints, or error text
indeterminateDOM propertyIndicates partial child selection; it is not a third submitted value

States and variants

Unchecked and checked are the normal interactive states. Disabled choices must explain why they are unavailable. Show invalid state only after submission or field departure so the page does not open with premature errors.

Selection and validation states

Only workspace owners can change this option.

indeterminate is a DOM property commonly used by a “select all” control. Form submission still follows checked, so applications must maintain both values explicitly.

Partial selection
Export scopes

Some scopes are selected.

const selectAll = document.querySelector("#select-all");
const selectedCount = 2;
const totalCount = 5;

selectAll.checked = selectedCount === totalCount;
selectAll.indeterminate = selectedCount > 0 && selectedCount < totalCount;

Multiple choices

Group related options with fieldset and legend. A label answers what the option is; supporting copy explains its consequence or constraint. Do not place an entire description inside the label.

Export content
Choose content to export

Select at least one item before starting the export.

Export confirmation

Required before the archive leaves the workspace.

Ready to confirm export.

Row selection inside a table belongs to the complete interaction model of Table or Data Grid. Its “select all” control must synchronize visible rows, cross-page scope, and indeterminate state; do not present an inert table gallery in Checkbox documentation.

Accessibility

  • Every checkbox needs an accessible name, preferably a visible label paired through id.
  • Group related options with fieldset and legend; do not add redundant role="group" to an ordinary .field.
  • Space toggles a focused native checkbox. Do not replace browser behavior with a custom click handler or block label activation.
  • Associate help and error copy with aria-describedby; set aria-invalid="true" when validation fails.
  • Keep the label and unavailability reason visible for disabled options. If users still need to understand or copy the content, disable only the control rather than hiding the row.
  • indeterminate communicates partial selection visually and semantically; form submission still follows checked.