A two-state or mixed choice the user toggles, with native form support, following the APG's checkbox pattern, in each framework.
A choice the user checks or clears (WAI-ARIA APG
checkbox pattern, the mixed state
included). It works in a native <form>: it submits, resets and validates as an
<input type="checkbox"> would. Several checkboxes sharing one array value, with a parent that
checks or clears them all, are a CheckboxGroup, shown in the example.
Toggle: a click on the Root or on its <label>, or Space; Enter does nothing (the APG, and
a native checkbox).
Mixed: indeterminate shows the mixed state (aria-checked="mixed"); a toggle from it
checks. The app sets it, or the group sets it on its parent checkbox.
Forms: a visually hidden checkbox input right after the Root submits name=value while
checked (value defaults to "on"), nothing while not. It is never in the accessibility tree
nor the tab order. required blocks the submission while unchecked and focuses the Root; a form
reset returns an uncontrolled checkbox to its default.
In a Field: the Root takes the field's ids, name, disabled and
states.
Every part also takes what the primitive contract gives:
render (Vue: as and the render slot), a class and a style, a ref, and any attribute, which
it forwards. The names below are React's; Vue binds them the same way (v-model:checked,
@checked-change), and Angular as inputs and outputs ([(checked)], (checkedChangeDetails)).