aria-labelledby
An ARIA attribute that names an element using the text of one or more other elements, referenced by their id.
In more detail
It has the highest priority in the accessible name computation. Dialogs use it to point at their heading, and tabs panels use it to point at their tab. The referenced element can even be hidden.
Examples
<div role="dialog" aria-labelledby="m1-t"><h2 id="m1-t">Profile</h2>...</div>useId generates the id in React so the pair stays unique.Related terms
- accessible name — The text assistive technology uses to identify a control, such as "Delete account" for a button.
- aria-describedby — An ARIA attribute that links an element to other elements, by id, whose text gives it a longer description.
- identifier — A name or number that picks out exactly one thing, such as one container, one image or one database row.
- modal dialog — A window laid over the page that users must deal with before returning to the page beneath, with role="dialog" and aria-modal="true".
- ARIA — The W3C standard of HTML attributes, such as role and aria-expanded, that tell assistive technology what a custom widget is and what state it is in.
- useId — The React hook that generates a unique ID string that is stable across renders and matches between server and browser.
Taught in
- Compound Component Patterns: Context Sharing & Internal State — Design Systems & Component Engineering
- Modal Dialogs & Alert Dialogs: Accessible Overlay Patterns — Design Systems & Component Engineering
- WAI-ARIA Semantics: Roles, States & Accessible Name Computation — Design Systems & Component Engineering
- Slot Patterns And Headless UI Architecture in React — React 19 & Modern Component Architecture