Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: react
accessibilityariaiconsa11y
Mark decorative icons inside labelled controls as hidden from assistive tech
When an icon is purely decorative inside a control that already has an accessible label, hide it from screen readers and the tab order instead of letting it be announced/focused.
PR: hegnar-forum-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <button aria-label="Upvote"> |
| 2 | <Icon /> |
| 3 | </button> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <button aria-label="Upvote"> |
| 2 | <Icon aria-hidden="true" focusable={false} /> |
| 3 | </button> |
Explanation (EN)
Objašnjenje (HR)