ARIA switch Role
The switch role marks an on/off toggle, like a light switch. It works like a checkbox but is announced as on or off rather than checked or not checked.
Description
The switch role is a type of checkbox that represents on and off values rather than checked and unchecked. It suits settings that take effect immediately, such as "Dark mode" or "Wi-Fi". The state is given by the required aria-checked attribute, and screen readers announce it as "on" or "off".
It is usually added to a <button> or a checkbox input, so the element is focusable and responds to the keyboard. Keep the label the same whatever the state. The mixed value isn't allowed. Safari supports a native switch with <input type="checkbox" switch>; elsewhere that renders as a normal checkbox, which is a reasonable fallback.
Properties
- Category
- Widget
- HTML equivalent
- None
- Accessible name from
- contents, author
- Required parent role
- None
- Required child roles
- None
ARIA Attributes
- Required
aria-checked- Supported
aria-readonly,aria-required- Prohibited
- None
- Global
- All global ARIA attributes can also be used, such as
aria-label,aria-labelledby,aria-describedby,aria-hidden.
Syntax
<element role="switch">
Example
Browser Support
The following information will show you the current browser support for the switch ARIA role. Hover over a browser icon to see the version that first introduced support for this ARIA role.
Desktop





Tablets & Mobile





