Skip to content

Checkbox

Forms

A checkbox with support for checked, unchecked, and indeterminate states.

atlas-checkbox

Examples

Basic

Bind [(checked)] . Give the checkbox an inputId and point a visible <label atlasLabel for> at it: the label names the checkbox and clicking it toggles the box.

Accepted: false

Select all (indeterminate)

indeterminate shows a dash and aria-checked="mixed" while only some children are checked. Clicking it checks every child; clicking again clears them.

Toppings

Must be checked, with Signal Forms

A custom rule requires the box to be checked. In atlas-form-field the label names the checkbox and the error, shown after submit, describes it.

API

Generated from the library source, so it always matches the code.

AtlasCheckboxComponent atlas-checkbox

InputTypeDefaultDescription
checked two-waybooleanfalse Whether the box is checked (two-way: [(checked)] , or Signal Forms [field] ).
disabled booleanfalse Disables the control. Set automatically when the control is bound with Signal Forms [field] .
errors readonly ValidationError.WithOptionalFieldTree[][] Validation errors of the bound field. Set by Signal Forms [field] .
required booleanfalse Whether a value is required. Set by Signal Forms [field] .
invalid booleanfalse Whether the field is invalid. Set by Signal Forms [field] .
touched booleanfalse Whether the user has interacted with the field. Set by Signal Forms [field] .
readonly booleanfalse Whether the field is read-only. Set by Signal Forms [field] .
pending booleanfalse Whether async validation is running. Set by Signal Forms [field] .
name string'' Name of the field. Set by Signal Forms [field] .
indeterminate two-waybooleanfalse Mixed state ( aria-checked="mixed" , a dash), e.g. a "select all" over a partial selection. It wins over checked for display; a click clears it and checks the box.
ariaLabel string | nullnull Accessible name when no visible label names the control (use one or the other, WCAG 2.5.3).
inputId string | undefinedundefinedid of the inner button, so a visible <label atlasLabel for="…"> names it and toggles it on click. Prefer it over ariaLabel when the label is on screen.
ariaDescribedBy string | nullnull Extra ids for aria-describedby , merged with the surrounding form field's hint or error.
class string'' Extra CSS classes, merged with the component's own through cn() ; yours win on conflicts.
OutputPayloadDescription
touchvoid Emits when the control loses focus, so Signal Forms marks the field touched.