rolecheckbox
Rolecheckbox, in web accessibility often described as the ARIA role role="checkbox", denotes a selectable toggle on non-native elements. It is used for custom widgets where a native input element cannot be used or where a specific visual design is required. The control communicates its state to assistive technologies through the aria-checked attribute, which may be true, false, or mixed to indicate an indeterminate state.
Accessibility and interaction guidelines emphasize keyboard operability: the element should be focusable (tabindex="0") and activatable via
Compared with a native input type=checkbox, the role="checkbox" approach relies on ARIA to convey state and behavior,
Common pitfalls include failing to implement keyboard activation, not updating aria-checked consistently, or providing insufficient labeling.