This action permanently deletes your account and cannot be undone
```
### Screen Reader Only Text
Use `sr-only` class for screen reader only content:
```tsx
// CSS for sr-only
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
```
### Live Regions
Announce dynamic content:
```tsx
{message}
// For urgent updates
{error}
```
Toast component includes live region:
```tsx
const { toast } = useToast()
toast({
title: "Success",
description: "Profile updated"
})
// Announced to screen readers automatically
```
## Form Accessibility
### Labels and Descriptions
**Always label inputs:**
```tsx
import { Label } from "@/components/ui/label"
import { Input } from "@/components/ui/input"
```
**Add descriptions:**
```tsx
import { FormDescription, FormMessage } from "@/components/ui/form"
Username
Your public display name
{/* Error messages */}
```
### Error Handling
Announce errors to screen readers:
```tsx
(
Email
)}
/>
```
### Required Fields
Indicate required fields:
```tsx
```
### Fieldset and Legend
Group related fields:
```tsx
```
## Component-Specific Patterns
### Accordion
```tsx
import { Accordion } from "@/components/ui/accordion"
{/* Includes aria-expanded, aria-controls automatically */}
Is it accessible?
{/* Hidden when collapsed, announced when expanded */}
Yes. Follows WAI-ARIA design pattern.
```
### Tabs
```tsx
import { Tabs } from "@/components/ui/tabs"
{/* Arrow keys navigate, Space/Enter activates */}
AccountPassword
{/* Hidden unless selected, aria-labelledby links to trigger */}
Account content
```
### Select
```tsx
import { Select } from "@/components/ui/select"
```
### Checkbox and Radio
```tsx
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
You agree to our Terms of Service and Privacy Policy
```
### Alert
```tsx
import { Alert } from "@/components/ui/alert"
{/* Announced immediately to screen readers */}
Error
Your session has expired
```
## Color Contrast
Ensure sufficient contrast between text and background.
**WCAG Requirements:**
- **AA**: 4.5:1 for normal text, 3:1 for large text
- **AAA**: 7:1 for normal text, 4.5:1 for large text
**Check defaults:**
```tsx
// Good: High contrast
Text
// Avoid: Low contrast
Hard to read
```
**Muted text:**
```tsx
// Use semantic muted foreground