semantic HTML
Using HTML elements for their meaning, such as <button> for actions and <nav> for navigation, rather than generic <div>s.
In more detail
Semantic elements come with roles, keyboard support and focus behaviour built in, and assistive technology already understands them. Custom widgets should start from them and add ARIA only where HTML has no equivalent.
Examples
In the browser: Semantic elements carry built-in meaning that browsers, screen readers and search engines understand, often including an implicit ARIA role. A page built only from div elements looks fine but gives assistive technology nothing to navigate by.Polymorphic React components let callers pick the right semantic tag instead of forcing a generic div.Related terms
- HTML — The markup language that describes the structure and meaning of a web page with elements such as <button>, <input> and <h2>.
- First Rule of ARIA — The guideline that you should not use ARIA if a native HTML element or attribute already gives the meaning and behaviour you need.
- 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.
- landmark — A region of a page, such as navigation, main content or footer, that assistive technology users can jump between.
- HTML element — One building block of a web page, such as a paragraph, a button or a section, made of a start tag, its content and an end tag.
- div element — A generic HTML container, div for blocks and span for inline text, that groups content for styling but says nothing about what the content is.
- implicit ARIA role — The ARIA role an HTML element has automatically, such as button for <button> or navigation for <nav>, without any role attribute.
- accessibility — Designing and building products so that people with disabilities, including those who use keyboards, screen readers or magnifiers, can use them fully.
- polymorphic component — A component that can render as different HTML elements or components, for example a Button that renders as a link.
Taught in
- Navigation & Disclosure: Dropdown Menus, Tabs & Accordions — Design Systems & Component Engineering
- WAI-ARIA Semantics: Roles, States & Accessible Name Computation — Design Systems & Component Engineering
- Semantic HTML Elements: Landmarks And Structure — Frontend Architecture & Web Platform
- Accessibility Tree, ARIA Roles, States And Live Regions — Frontend Architecture & Web Platform
- Props Contract: Immutability, Children, And Polymorphic Tags — React 19 & Modern Component Architecture