checkbox
A form control that can be checked or unchecked, usually submitted with a form.
In more detail
A checkbox suggests the choice takes effect when the form is saved. A switch suggests the setting changes immediately, so settings that apply instantly should use role="switch" instead.
Example
In the browser: Each checkbox is independent, unlike radio buttons, where only one option in a group can be chosen. Its state is exposed to CSS through :checked.Related terms
- switch role — The ARIA role for an on/off control whose change takes effect immediately, like a light switch.
- form control — An element that collects user input, such as a text input, checkbox, switch, select or button.
- form state pseudo-classes — Pseudo-classes such as :checked, :invalid and :disabled that match form controls by their current state.
Taught in
- Actionable Form Primitives: Buttons, Switches & Inputs — Design Systems & Component Engineering
- Modern Selectors: :has(), :is(), :where() And Nesting Standards — Frontend Architecture & Web Platform