What is ARIA and When Do You Need It?
You'll learn: What ARIA is and when to use it to fill accessibility gaps that semantic HTML can't solve alone.
The Core Idea
ARIA stands for Accessible Rich Internet Applications. It's a set of special HTML attributes that add extra information about roles, states, and properties to help assistive technologies (like screen readers) understand complex interactive elements.
Think of ARIA like subtitles for your interface. Semantic HTML is like clear dialogue that most people can understand naturally. But when you build something complex—like a custom dropdown, tabbed interface, or modal dialog—assistive technologies might not recognize what it does. ARIA provides the "subtitles" that explain the element's purpose and current state.
When Semantic HTML Isn't Enough
You've learned to use semantic elements like <button>, <nav>, <main>, and <label> because they have built-in accessibility. But sometimes you need to:
- Build custom widgets that don't have native HTML equivalents (tree menus, sliders, carousels)
- Communicate dynamic state changes (a menu is expanded, an item is selected)
- Add context that HTML alone can't express (which element controls another)
For example, a native <button> already tells screen readers it's a button. But if that button toggles a menu open or closed, you might add aria-expanded="true" or aria-expanded="false" to communicate the current state.
The Golden Rule
Don't use ARIA when semantic HTML works. A real <button> is always better than <div role="button">. Use ARIA only when you genuinely need to enhance or modify what semantic elements provide.
Key Takeaway: ARIA supplements semantic HTML by describing roles, states, and relationships that HTML can't express alone—use it only when necessary to make complex interactions accessible.