# WCAG 2.2 Guidelines Reference
## Overview
The Web Content Accessibility Guidelines (WCAG) 2.2 provide recommendations for making web content more accessible. They are organized into four principles (POUR): Perceivable, Operable, Understandable, and Robust.
## Conformance Levels
- **Level A**: Minimum accessibility (must satisfy)
- **Level AA**: Standard accessibility (should satisfy)
- **Level AAA**: Enhanced accessibility (may satisfy)
Most organizations target Level AA compliance.
## Principle 1: Perceivable
Content must be presentable in ways users can perceive.
### 1.1 Text Alternatives
#### 1.1.1 Non-text Content (Level A)
All non-text content needs text alternatives.
```tsx
// Images
// Decorative images
// Complex images with long descriptions
The CEO reports to the board. Three VPs report to the CEO:
VP Engineering, VP Sales, and VP Marketing...
// Icons with meaning
// Icon buttons with visible text
```
### 1.2 Time-based Media
#### 1.2.1 Audio-only and Video-only (Level A)
```tsx
// Audio with transcript
View transcript
Full transcript text here...
// Video with captions
```
### 1.3 Adaptable
#### 1.3.1 Info and Relationships (Level A)
Structure and relationships must be programmatically determinable.
```tsx
// Proper heading hierarchy
Page Title
Section Title
Subsection
// Data tables with headers
Quarterly Sales Report
Product
Q1
Q2
Widget A
$10,000
$12,000
// Lists for grouped content
```
#### 1.3.5 Identify Input Purpose (Level AA)
```tsx
// Input with autocomplete for autofill
```
### 1.4 Distinguishable
#### 1.4.1 Use of Color (Level A)
```tsx
// Bad: Color only indicates error
// Good: Color plus icon and text
{hasError && (
This field is required
)}
```
#### 1.4.3 Contrast (Minimum) (Level AA)
```css
/* Minimum contrast ratios */
/* Normal text: 4.5:1 */
/* Large text (18pt+ or 14pt bold+): 3:1 */
/* Good contrast examples */
.text-on-white {
color: #595959; /* 7:1 ratio on white */
}
.text-on-dark {
color: #ffffff;
background: #333333; /* 12.6:1 ratio */
}
/* Link must be distinguishable from surrounding text */
.link {
color: #0066cc; /* 4.5:1 on white */
text-decoration: underline; /* Additional visual cue */
}
```
#### 1.4.11 Non-text Contrast (Level AA)
```css
/* UI components need 3:1 contrast */
.button {
border: 2px solid #767676; /* 3:1 against white */
background: white;
}
.input {
border: 1px solid #767676;
}
.input:focus {
outline: 2px solid #0066cc; /* Focus indicator needs 3:1 */
outline-offset: 2px;
}
/* Custom checkbox */
.checkbox {
border: 2px solid #767676;
}
.checkbox:checked {
background: #0066cc;
border-color: #0066cc;
}
```
#### 1.4.12 Text Spacing (Level AA)
Content must not be lost when user adjusts text spacing.
```css
/* Allow text spacing adjustments without breaking layout */
.content {
/* Use relative units */
line-height: 1.5; /* At least 1.5x font size */
letter-spacing: 0.12em; /* Support for 0.12em */
word-spacing: 0.16em; /* Support for 0.16em */
/* Don't use fixed heights on text containers */
min-height: auto;
/* Allow wrapping */
overflow-wrap: break-word;
}
/* Test with these values: */
/* Line height: 1.5x font size */
/* Letter spacing: 0.12em */
/* Word spacing: 0.16em */
/* Paragraph spacing: 2x font size */
```
#### 1.4.13 Content on Hover or Focus (Level AA)
```tsx
// Tooltip pattern
function Tooltip({ content, children }) {
const [isVisible, setIsVisible] = useState(false);
return (
e.key === "Escape" && setIsVisible(false)}
// Hoverable: content stays visible when pointer moves to it
onMouseEnter={() => setIsVisible(true)}
onMouseLeave={() => setIsVisible(false)}
// Persistent: stays until trigger loses focus/hover
>
{content}
)}
);
}
```
## Principle 2: Operable
Interface components must be operable by all users.
### 2.1 Keyboard Accessible
#### 2.1.1 Keyboard (Level A)
All functionality must be operable via keyboard.
```tsx
// Custom interactive element
function CustomButton({ onClick, children }) {
return (