I Learned The First Rule of ARIA the Hard Way
These articles are AI-generated summaries. Please check the original sources for full details.
The Pitfalls of Overusing ARIA
A developer shipped a seemingly accessible component, passing all automated tests and keyboard navigation checks, but a screen reader user couldn’t interact with it. The root cause was an unnecessary role="link" attribute added to a <button> element, demonstrating how ARIA can introduce ambiguity when used to supplement existing semantic HTML.
Why This Matters
The ideal model assumes developers correctly implement ARIA to enhance accessibility, but reality shows ARIA is often misused, leading to degraded user experiences. Poorly implemented ARIA can introduce conflicts with native element behavior, creating confusion for assistive technologies and ultimately increasing the cost of remediation – a single accessibility bug can impact a significant percentage of users, and legal repercussions for non-compliance are substantial.
Key Insights
- ARIA is not a replacement for semantic HTML: Adding ARIA roles to elements that already have appropriate semantic meaning can break accessibility.
- Native elements have built-in accessibility: Browsers provide default accessibility features for semantic HTML elements like
<button>and<a>. aria-expandedfor dynamic state: ARIA is best used to communicate missing state or dynamic changes, like the expanded/collapsed state of a widget.
Working Example
const button = document.getElementById("toggle");
const panel = document.getElementById("panel");
button.addEventListener("click", () => {
const expanded = button.getAttribute("aria-expanded") === "true";
button.setAttribute("aria-expanded", !expanded);
panel.hidden = expanded;
});
Practical Applications
- Disclosure Widget: Use a native
<button>witharia-expandedto indicate whether a collapsible panel is open or closed. - Pitfall: Using
role="link"on a<button>to style it like a link can break expected keyboard behavior and confuse screen readers.
References:
Continue reading
Next article
CVE-Alert: Free Real-Time Vulnerability Tracking by Dataforge
Related Content
Why Semantic HTML Buttons Outperform Divs with ARIA Roles for Accessibility
Using <button> instead of <div role='button'> improves accessibility by 80% in keyboard and screen reader interactions.
Local AI-First Architecture: Building a SaaS with Gemma 4 and Ollama
Developer Ian Akiles is building a local financial SaaS using Gemma 4 and Ollama to prove that complex AI insights can run without cloud APIs.
Pure CSS Tabs With Details, Grid, and Subgrid
A modern approach to creating accessible CSS-only tabs using the <details> element, CSS Grid, and Subgrid, with practical implementation examples and accessibility considerations.