LWC Accessibility - MCP Knowledge

Based on Real Implementation Experience: These guidelines combine official MCP accessibility guidance with patterns from real LWC projects.

Overview

Accessibility ensures all users, including those using assistive technologies, can use your LWCs. This document summarizes key patterns for:

Prerequisites

When to Use

Use This When

Avoid This When

Core Concepts

Semantic HTML

ARIA Usage

Focus Management

Patterns and Examples

Pattern 1: Accessible Form

Pattern 2: Keyboard-Accessible Components

Edge Cases and Limitations

Q&A

Q: Do I still need ARIA if I use Lightning base components?

A: Lightning base components implement most ARIA and keyboard patterns for you. You generally don’t need to add ARIA to them, but you still need to ensure correct labels and structure around them.

Q: How do I test LWC accessibility?

A: Use a combination of: (1) Automated tests (Sa11y, Jest with axe), (2) Keyboard testing (tab through UI), (3) Screen readers (NVDA, VoiceOver), and (4) Color contrast tools. See lwc-accessibility-testing.md for detailed patterns.