Checkbox
Formsatlas-checkboxExamples
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.
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
| Input | Type | Default | Description |
|---|---|---|---|
| checked two-way | boolean | false | [(checked)] , or Signal Forms [field] ). |
| disabled | boolean | false | [field] . |
| errors | readonly ValidationError.WithOptionalFieldTree[] | [] | [field] . |
| required | boolean | false | [field] . |
| invalid | boolean | false | [field] . |
| touched | boolean | false | [field] . |
| readonly | boolean | false | [field] . |
| pending | boolean | false | [field] . |
| name | string | '' | [field] . |
| indeterminate two-way | boolean | false | 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 | null | null | |
| inputId | string | undefined | undefined | id 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 | null | null | aria-describedby , merged with the surrounding form field's hint or error. |
| class | string | '' | cn() ; yours win on conflicts. |
| Output | Payload | Description |
|---|---|---|
| touch | void |