Cheatsheets

Accessibility & ARIA Cheatsheet

Use this quick reference to choose semantic HTML first, add ARIA only when native semantics are insufficient, and verify keyboard, form and dynamic-content behavior.

Quick reference

Semantic HTML first

Action<button type="button">Save</button>

Use a button for an action, not a clickable div.

Navigation<nav aria-label="Primary">…</nav>
Main content<main>…</main>
Form group<fieldset><legend>Preferences</legend>…</fieldset>
Disclosure<details><summary>Question</summary>…</details>

Names and descriptions

Visible label<label for="email">Email</label>
Label by elementaria-labelledby="dialog-title"
Extra instructionsaria-describedby="password-hint"
Icon buttonaria-label="Close dialog"
Decorative contentaria-hidden="true"

State and relationships

Expanded statearia-expanded="false"
Controlled panelaria-controls="menu-panel"
Current pagearia-current="page"
Invalid fieldaria-invalid="true"
Required fieldrequired

Prefer the native attribute when it applies.

Keyboard expectations

Tab / Shift+TabMove through focusable elements
EnterActivate links and most buttons
SpaceActivate buttons and toggle checkboxes
EscapeClose dismissible overlays where expected
Arrow keysUse for composite widgets such as radio groups, tabs and menus

Dynamic content

Polite status<p role="status">Saved</p>
Urgent error<div role="alert">Payment failed</div>
Live regionaria-live="polite"

The region should exist before its text changes.

Busy statearia-busy="true"

Common mistakes

Clickable divUse <button> or <a> instead
Redundant roleAvoid role="button" on <button>
Hidden focusDo not remove outlines without a visible replacement
ARIA instead of HTMLPrefer native semantics and behavior

Examples

CodeDescribed form error
<label for="email">Email</label>
<input id="email" type="email" aria-describedby="email-hint email-error" aria-invalid="true" />
<p id="email-hint">Use your work address.</p>
<p id="email-error" role="alert">Enter a valid email address.</p>
CodeAccessible menu button
<button type="button" aria-expanded="false" aria-controls="site-menu">Menu</button>
<ul id="site-menu" hidden>…</ul>

Accessibility & ARIA FAQ

What is included in the Accessibility & ARIA cheatsheet?

Accessibility & ARIA Cheatsheet includes quick reference sections, practical examples, common mistakes, tips and links to related DevKitYard tools.

Is the Accessibility & ARIA cheatsheet interactive?

This cheatsheet is a static quick reference focused on concise commands, syntax and examples.

When should I use this Accessibility & ARIA reference?

Use it when you need to recall syntax, compare common patterns or avoid mistakes without opening a long tutorial.

What should I use after reading this cheatsheet?

Use related DevKitYard tools such as Contrast Checker when you need to format, validate, generate or inspect real output.