Skip to main content
Checks that interactive elements have accessible names
Rule IDa11y/aria-labels
CategoryAccessibility
ScopePer-page
Severityerror
Weight6/10

Solution

All interactive elements (buttons, links, inputs) need accessible names for screen readers. Use: visible text content, aria-label for icon-only buttons, aria-labelledby to reference existing text, or the title attribute as a fallback. Icon buttons especially need aria-label: . Test with a screen reader or browser accessibility inspector.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["a11y/aria-labels"]

Disable all Accessibility rules

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

Enable only this rule

squirrel.toml
[rules]
enable = ["a11y/aria-labels"]
disable = ["*"]