Checkbox
Boolean form control (checked/unchecked) with optional indeterminate state, label, and validation.
HTML tag: c-e703e41124a834f24aa86d3268c8f00ad
When to use
Section titled “When to use”- boolean yes/no or on/off field
- accept terms or enable feature toggle
- single true/false (not one-of-many)
| Prop | Type | Default | Description |
|---|---|---|---|
value | Boolean | ||
indeterminate | Boolean | ||
required | Boolean | ||
disabled | Boolean | ||
label | String | ||
readonly | Boolean | ||
helper_text | String | ||
error_text | String | ||
status | String | default | |
name | String | ||
aria_label | String | ||
aria_describedby | String | ||
size | String | md | |
density | String | comfortable | |
tone | String | neutral | |
label_position | String | inline | |
readonly_tooltip | String |
- Bind .value as Boolean.
- Use input-changed for live toggles; value-committed when the value is finalized; validated after validate().
- Use ab-radio-group when choosing one of several string options, not ab-checkbox.
Events
Section titled “Events”| Event | Detail |
|---|---|
input-changed | value: Boolean |
validated | valid: Boolean, errors: Array |
value-committed | value: Boolean |
focus | |
blur |
Methods
Section titled “Methods”| Signature | Description |
|---|---|
focus() | |
blur() | |
toggle() | |
setValue(value: Boolean, options: Object) | |
setIndeterminate(indeterminate: Boolean) | |
validate() |
What to avoid
Section titled “What to avoid”Do not use for multi-option single choice (ab-radio-group or ab-select). Do not use for text entry (ab-input).
Example
Section titled “Example”<c-e703e41124a834f24aa86d3268c8f00ad .label=${'Accept terms'} .value=${accepted} .required=${true} @input-changed=${e => accepted = e.detail.value}></c-e703e41124a834f24aa86d3268c8f00ad>