liminfo

WCAG Accessibility Reference

Free reference guide: WCAG Accessibility Reference

22 results

About WCAG Accessibility Reference

This WCAG Accessibility Reference is a structured, searchable guide to the Web Content Accessibility Guidelines (WCAG) 2.1 success criteria, organized by the four foundational principles: Perceivable, Operable, Understandable, and Robust. Each entry shows the criterion number, conformance level (A, AA, or AAA), a plain-language description, and practical HTML/ARIA code examples that demonstrate how to implement each requirement in real web projects.

The Perceivable section covers criteria for making content accessible to all senses, including 1.1.1 text alternatives for images (alt attributes, aria-label for SVG), 1.2.2 synchronized captions for video, 1.3.1 programmatic structure with semantic HTML, 1.4.3 minimum contrast ratio of 4.5:1 for normal text and 3:1 for large text at AA level, 1.4.6 enhanced contrast of 7:1 at AAA level, 1.4.11 non-text contrast for UI components, and 1.4.12 text spacing adaptability. The Operable section addresses keyboard accessibility (2.1.1), no keyboard traps (2.1.2), timing controls (2.2.1), flash thresholds (2.3.1), skip navigation (2.4.1), visible focus indicators (2.4.7), and single-pointer alternatives for gestures (2.5.1).

The Understandable section documents page language declaration (3.1.1), no unexpected changes on focus (3.2.1), error identification with aria-invalid and role="alert" (3.3.1), input labels and instructions (3.3.2), and error prevention for legal/financial submissions (3.3.4). The Robust section covers 4.1.2 name/role/value for custom UI components using ARIA attributes and 4.1.3 status messages with aria-live regions. This reference is essential for web developers, QA engineers, UX designers, and project managers working toward WCAG compliance.

Key Features

  • All four WCAG principles covered: Perceivable, Operable, Understandable, and Robust with criterion numbers and conformance levels
  • Contrast ratio requirements at both AA (4.5:1 text, 3:1 UI) and AAA (7:1 text) levels with practical measurement guidance
  • Keyboard accessibility criteria: full keyboard operation (2.1.1), no traps (2.1.2), visible focus (2.4.7), skip links (2.4.1)
  • ARIA implementation examples: aria-label, aria-invalid, aria-describedby, aria-live, role="alert", role="progressbar"
  • Form accessibility patterns: error identification with role="alert", label associations, and error prevention workflows
  • Media accessibility: video captions with track element, text alternatives for non-text content including SVG and images
  • Timing and motion criteria: adjustable time limits (2.2.1), flash thresholds (2.3.1), and prefers-reduced-motion support
  • Searchable by criterion number, keyword, or principle category for quick lookup during accessibility audits

Frequently Asked Questions

What is the difference between WCAG Level A, AA, and AAA?

Level A is the minimum conformance level with essential requirements that must be met (e.g., text alternatives, keyboard access). Level AA is the standard target for most websites and includes A requirements plus enhanced criteria like 4.5:1 contrast ratio and visible focus indicators. Level AAA is the highest level with stricter requirements like 7:1 contrast ratio, but achieving full AAA conformance across an entire site is often not feasible. Most legal requirements and organizational policies target Level AA.

What contrast ratio do I need for my text to be WCAG compliant?

For WCAG AA: normal text (under 18pt or 14pt bold) needs at least 4.5:1 contrast ratio, and large text (18pt+ or 14pt+ bold) needs at least 3:1. For AAA: normal text needs 7:1 and large text needs 4.5:1. Non-text UI components (buttons, input borders, icons) need 3:1 against their background at AA level (criterion 1.4.11). Use browser DevTools or contrast checking tools to measure these ratios against your background colors.

How do I make a custom component accessible with ARIA?

Follow WCAG 4.1.2 (Name, Role, Value): give every interactive element a name (aria-label or visible label), a role (native HTML elements have implicit roles, or use role="button", role="progressbar", etc.), and expose dynamic values (aria-valuenow, aria-expanded, aria-checked). For custom widgets, also manage focus with tabindex, handle keyboard events (Enter, Space, arrow keys per ARIA Authoring Practices), and announce state changes with aria-live regions.

What is a skip navigation link and how do I implement it?

A skip navigation link (WCAG 2.4.1) lets keyboard users bypass repeated content blocks like headers and navigation menus to jump directly to the main content. Implement with: <a href="#main" class="skip-link">Skip to main content</a> placed as the first focusable element, and <main id="main"> wrapping your page content. Style it to be visually hidden until focused, then visible on :focus. This dramatically improves the experience for keyboard-only users.

How do I properly identify and announce form errors?

For WCAG 3.3.1: mark invalid fields with aria-invalid="true" and link error messages using aria-describedby pointing to the error text element. Use role="alert" or aria-live="assertive" on the error message container so screen readers announce it immediately. For WCAG 3.3.2, always provide visible labels with <label for="fieldId"> and helpful placeholder text or instructions. For 3.3.4, provide a confirmation step and undo capability for important submissions.

Why is keyboard accessibility so important and what does "no keyboard trap" mean?

Keyboard accessibility (2.1.1) is critical because many users cannot use a mouse: screen reader users, people with motor disabilities, and power users who prefer keyboard navigation. Every interactive element must be reachable with Tab and activatable with Enter/Space. "No keyboard trap" (2.1.2) means a user must never get stuck in a component where Tab/Escape cannot exit. Modals are the most common keyboard trap; always implement an Escape key handler and return focus to the trigger element on close.

How do I handle the prefers-reduced-motion media query for accessibility?

WCAG 2.3.1 prohibits content that flashes more than three times per second. Beyond that, many users with vestibular disorders experience discomfort from animations. Use @media (prefers-reduced-motion: reduce) in CSS to disable or minimize non-essential animations, transitions, and auto-playing content. In JavaScript, check window.matchMedia("(prefers-reduced-motion: reduce)").matches to conditionally skip animations. Always provide a pause button for auto-advancing carousels and slideshows.

What is aria-live and when should I use "polite" vs "assertive"?

aria-live creates a live region that screen readers monitor for content changes. Use aria-live="polite" for non-urgent updates that should be announced after the screen reader finishes its current task (e.g., "Loading complete", search result counts). Use aria-live="assertive" (or role="alert") for urgent messages that interrupt the user immediately (e.g., form validation errors, session timeout warnings). Overusing assertive interrupts the user experience, so prefer polite for most status updates per WCAG 4.1.3.