Getting started
UI
W.Feature
Widget
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.
<button>
, <nav>
, <main>
, etc.)All our components meet WCAG 2.2 Level AA contrast requirements by default, with many meeting the stricter AAA level.
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 */
}
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.
We handle focus carefully:
<!-- Use buttons for actions -->
<button type="button" onClick={handleAction}> Perform Action </button>
<!-- Use links for navigation -->
<a href="/some-page"> Go to Page </a>
<!-- 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>
<!-- Live regions for important updates -->
<div role="status" aria-live="polite">Status message</div>
<!-- Busy indicators -->
<button aria-busy="true"> Processing... </button>
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
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.