0.6.13

Accessibility

Our approach to accessibility

Accessibility isn’t an afterthought in Accessible Astro—it’s our foundation. We follow the WAI-ARIA guidelines and WCAG 2.2 standards to ensure our components and themes work for everyone, regardless of how they interact with the web.

Key principles

1. Semantic HTML

2. Keyboard navigation

3. ARIA implementation

4. Visual considerations

All our components meet WCAG 2.2 Level AA contrast requirements by default, with many meeting the stricter AAA level.

User preferences

We respect user preferences through:

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  /* Motion-based animations are disabled */
}

/* Color scheme */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles */
}

/* Contrast (coming soon) */
@media (prefers-contrast: more) {
  /* High contrast styles */
}

Screen reader support

Our components are tested with popular screen readers:

We recommend testing your implementation with real screen readers to ensure the best experience for your users.

Focus management

We handle focus carefully:

Common patterns

<!-- Use buttons for actions -->
<button type="button" onClick={handleAction}> Perform Action </button>

<!-- Use links for navigation -->
<a href="/some-page"> Go to Page </a>

Hidden content

<!-- Visually hidden but available to screen readers -->
<span class="sr-only">Additional context</span>

<!-- Hidden from all users -->
<div hidden>Not visible or announced</div>

Dynamic content

<!-- Live regions for important updates -->
<div role="status" aria-live="polite">Status message</div>

<!-- Busy indicators -->
<button aria-busy="true"> Processing... </button>

Best practices

  1. Test early and often
  1. Progressive enhancement
  1. Clear communication

We recommend using the eslint-plugin-jsx-a11y package to catch common accessibility issues during development. This plugin is already included in our starter themes:

npm install -D eslint-plugin-jsx-a11y

Resources

Testing tools

While automated tools are helpful, they can’t catch all accessibility issues. Manual testing and user feedback are essential. See our accessibility testing page for more information.