Switch
Formsatlas-switchExamples
Basic
A switch toggles a setting on or off immediately. Bind [(checked)] ; inputId plus <label atlasLabel for> makes the visible text its name and a click target.
Weekly summary of activity.
Alerts on this device.
Described and disabled
ariaDescribedBy links the hint under each setting, so it is read with the switch. A setting that cannot change right now is disabled , and its hint says why.
Runs at 02:00, keeps 30 days.
Only an owner can change this.
Dependent settings with Signal Forms
Bound with [formField] , a switch follows its field, including disabled : the disabled rule turns "Product news" off while email notifications are off.
Email: true, product news: false
API
Generated from the library source, so it always matches the code.
AtlasSwitchComponent atlas-switch
| 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] . |
| 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 |