# Svelte Accessibility (A11y) Guide
## Overview
Accessibility is crucial for inclusive web applications. Svelte provides built-in accessibility warnings, and this guide covers best practices for building accessible Svelte applications.
---
## ๐ฏ Core Principles (POUR)
1. **Perceivable** - Users can perceive the content
2. **Operable** - Users can operate the interface
3. **Understandable** - Users can understand the content
4. **Robust** - Content works across assistive technologies
---
## โจ๏ธ Keyboard Navigation
### Focus Management
```svelte
{#if dialogOpen}
Dialog Title
Dialog content...
{/if}
```
### Focus Trap
```svelte
```
### Skip Links
```svelte
Skip to main content
```
---
## ๐ท๏ธ ARIA Attributes
### Roles
```svelte
......
Important message!
Status update
Dialog content
...
...
```
### States & Properties
```svelte
Panel content
selected = !selected}
>
Option
We'll never share your email
Invalid email format
```
### Live Regions
```svelte
{message}
{#if error}
{error}
{/if}
{items.length} items in cart
```
---
## ๐ Forms
### Accessible Form Pattern
```svelte
```
### Field Group
```svelte
```
---
## ๐ผ๏ธ Images & Media
### Image Alternatives
```svelte
This chart shows quarterly revenue for 2024. Q1: $1.2M, Q2: $1.5M,
Q3: $1.9M, Q4: $2.1M. Total annual revenue was $6.7M, representing
a 15% increase over 2023.
```
### Video Accessibility
```svelte
```
---
## ๐งฉ Accessible Components
### Accordion
```svelte
{#each items as item, index (item.id)}
{@const isOpen = openId === item.id}