Skip to main content
Checks that toggle fields (checkbox, radio, switch) have accessible names
Rule IDa11y/aria-toggle-field-name
CategoryAccessibility
ScopePer-page
Severityerror
Weight7/10

Solution

Toggle fields need accessible names to describe what they control. Use <label for='id'>, aria-label, aria-labelledby, or wrap in <label>. Example: <label>``<input type='checkbox'> Subscribe to newsletter</label>

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["a11y/aria-toggle-field-name"]

Disable all Accessibility rules

squirrel.toml
[rules]
disable = ["a11y/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["a11y/aria-toggle-field-name"]
disable = ["*"]