The Critical Importance of Accessibility in JSX: Why Missing alt Text is More Than Just a Warning
Ignoring accessibility in JSX—especially missing alt text for images—creates barriers for users with disabilities and exposes your application to legal risks. Here’s why it matters and how to fix it properly:
1. Why alt Text Matters
Impact of Missing Alt Text
User Group
Problem They Face
Screen reader users
Hear “image” with no context
Slow internet users
See broken images with no fallback
SEO crawlers
Can’t index image content
Legal compliance
Violates WCAG 2.1 (ADA lawsuits)
Real-World Consequences
Target ($6M settlement, 2008): Failed to describe product images
Domino’s (SCOTUS case, 2019): Website inaccessible to blind users
2. Proper alt Text Implementation
Basic Image
// BAD (Missing alt)
<img src="logo.png" />
// ✅ GOOD (Descriptive alt)
<img
src="logo.png"
alt="Company logo: Acme Inc."
/>
Decorative Images
// ✅ CORRECT: Empty alt for decorative images
<img
src="divider.png"
alt=""
aria-hidden="true" // Extra assurance for screen readers
/>
Complex Images
// ✅ For charts/diagrams: alt + longdesc or adjacent text
<img
src="sales-chart.png"
alt="2023 Q4 sales: 45% growth shown in blue bars"
/>
<p className="sr-only">Detailed breakdown: North America contributed 60%...</p>