This repository contains a single index.html
file that showcases a wide range of accessible HTML components. It demonstrates how to implement ARIA roles, ARIA attributes, and semantic HTML to build inclusive web content that works better for screen readers and assistive technologies.
The HTML file includes fully accessible versions of:
- Proper use of landmarks:
<header>
,<nav>
,<main>
,<aside>
,<footer>
- Use of headings (
<h1>
–<h6>
) in proper hierarchy
-
Accordion
- Implemented using buttons and
aria-expanded
- Associated regions with
aria-controls
androle="region"
- Implemented using buttons and
-
Show/Hide Toggle Sections
- Buttons with
aria-expanded
,aria-controls
- Buttons with
-
Alert Messages
- Live regions using
role="alert"
andaria-live="assertive"
- Live regions using
-
Navigation Menu
<nav>
withrole="navigation"
and labeled usingaria-label
- Keyboard-focusable links
-
Modal Dialog
- Proper
role="dialog"
orrole="alertdialog"
- Focus trapping
aria-modal
,aria-labelledby
, andaria-describedby
- Proper
-
Form Elements
- Labels associated with inputs
- ARIA attributes for error messaging (
aria-invalid
,aria-describedby
) role="form"
and field grouping withfieldset
andlegend
- Logical tab order
- Visible focus indicators
- Proper screen reader guidelines
The goal of this demo is to:
- Showcase how to make HTML element accessible
- Educate developers on using ARIA and semantic elements correctly
- Provide a reference boilerplate for accessible components
Feel free to fork this repo and extend accessibility examples or add your improvements.
Pull requests welcome!
Accessibility matters. Let's build web for everyone.