A11y Patterns

ARIA Attributes Guide

Accessible Rich Internet Applications — the standard for conveying UI state, roles, and relationships that semantic HTML alone cannot express to assistive technologies.

3 Rules of ARIA Use

1

HTML first

If semantic HTML can express it, do not use ARIA. A <button> is better than role="button".

2

Do not change native semantics

Do not override built-in meaning, like <h1 role="button">.

3

Interactive elements must support keyboard

If you add a role, you must also implement the corresponding keyboard behavior (Enter, Space, Arrow keys, etc.).

Roles (role)

Landmark roles

banner

Page header area. Equivalent to <header>.

navigation

Navigation link group. Equivalent to <nav>.

main

Page's primary content. Equivalent to <main>.

complementary

Supporting content (like a sidebar). Equivalent to <aside>.

contentinfo

Page footer area. Equivalent to <footer>.

region

A named section. Use with aria-label.

Widget roles

dialog

Modal dialog. Requires aria-modal="true" and focus trapping.

tablist / tab / tabpanel

Tab UI composition. These three roles work as a set.

combobox

Search + dropdown combination. Requires aria-expanded and aria-controls.

listbox / option

Selection list. Used for custom <select> implementations.

alert

Message that must be read immediately. Automatically acts as aria-live="assertive".

status

Non-urgent status message. Acts as aria-live="polite".

States and properties (aria-*)

States

aria-expanded

Indicates whether an element is expanded. Used for accordions, dropdowns.

aria-checked

Indicates checked state. Values: true / false / mixed.

aria-disabled

Indicates disabled state. Unlike disabled, focus is maintained.

aria-selected

Indicates selected state. Used for tabs, listbox options.

aria-pressed

Indicates the pressed state of a toggle button.

aria-hidden

Completely hides from assistive technologies. Used for decorative elements.

Relations

aria-label

Provides an accessible name directly on the element. Used for buttons without visible text.

aria-labelledby

References another element by ID to provide a name. Preferred when text is already on screen.

aria-describedby

Connects additional description text. Used for input field error messages and hint text.

aria-controls

References the ID of the element this element controls. Tab→panel, button→dropdown.

aria-owns

Expresses a logical ownership relationship that is not a DOM parent-child relationship.

Live regions (aria-live)

aria-live="polite"

Reads changes after the current content finishes. Used for search result counts, success messages.

aria-live="assertive"

Interrupts and reads changes immediately. Use only for urgent notifications like error messages.

aria-atomic="true"

Reads the entire region content when any part changes. Used when full context is needed over partial updates.

aria-relevant

Specifies which changes (additions/removals/text) to announce. Default is additions text.