Accessibility
- The input has
role="switch"and is named by its label; supporting text describes it througharia-describedby, and the error state setsaria-invalid. Tabfocuses it;SpaceandEntertoggle it, as the M3 switch accessibility guidance has it.- Keyboard focus draws a 0.10 state layer on the handle and a 3dp focus ring around the track; a pointer shows no ring.
- In right-to-left layouts the handle runs from right to left.
- When the label is ambiguous, set
ariaLabel: "Photo album access" rather than "Photo album".