React and Vue accessibility setup differs in the lint rules and component APIs you configure. The browser checks can share the same approach: Playwright’s accessibility testing guide shows how to scan the rendered page with axe, including content revealed by an interaction. Build framework-specific checks around that shared browser suite, then review keyboard use and screen-reader behavior across the actual application journey.
Don't miss new tech stories on Google
Add Tech Insider once in the Google app and our stories appear in your news suggestions.
Separate framework setup from browser checks
For source checks, the JSX accessibility plugin evaluates JSX, while the Vue accessibility plugin checks .vue files. Install the plugin that matches the source being linted. A project containing both needs coverage for both kinds of files.
For modal components, Adobe’s React Aria Modal uses isOpen and onOpenChange for controlled state. Headless UI’s Vue Dialog uses an open prop and a close event. That difference belongs in the component implementation; the user-facing acceptance criteria should stay consistent.
| Setup layer | React | Vue |
|---|---|---|
| Source accessibility checks | eslint-plugin-jsx-a11y for JSX |
eslint-plugin-vuejs-accessibility for Vue files |
| Modal state interface | React Aria: isOpen, onOpenChange |
Headless UI: :open, @close |
| Rendered-page scan | AxeBuilder against the page under test |
The same AxeBuilder pattern against the Vue page |
Tech Insider’s recommendation is to keep accessibility acceptance independent of the framework decision. Use the broader React and Vue comparison for that decision, and require the same usable form, dialog and navigation journeys from either implementation.
Scaffold projects with supported prerequisites
For a new demonstration project, Vite’s getting started guide supports React and Vue templates in JavaScript and TypeScript. Its documented Node.js requirement is 20.19+ or 22.12+; individual templates can require a higher version. Existing applications can add the checks below without creating a replacement project.
| Prerequisite | Documented requirement |
|---|---|
| Vite project creation | Node.js 20.19+ or 22.12+; follow a template’s higher requirement if reported |
| Headless UI Vue components | Vue 3 |
The following commands retain separate applications and use JavaScript templates. Choose react-ts and vue-ts instead if your project already has a TypeScript lint configuration. Run each project’s commands from its own directory.
npm create vite@latest a11y-react-demo -- --template react
cd a11y-react-demo
npm install
cd ..
npm create vite@latest a11y-vue-demo -- --template vue
cd a11y-vue-demo
npm install
Start the application with npm run dev. Keep the accessibility test URL explicit when switching between applications, so the test is aimed at the intended running page.
Scope linting to JSX and Vue templates
The JSX plugin documents a recommended flat configuration, but that configuration does not supply files or browser globals. Keep your existing project lint configuration and add the accessibility rules with a matching file scope. For the JavaScript React scaffold, a dedicated accessibility-only configuration can look like this:
npm install --save-dev eslint eslint-plugin-jsx-a11y
Save this as eslint.a11y.config.mjs in the React project:
import jsxA11y from 'eslint-plugin-jsx-a11y';
const jsxChecks = {
...jsxA11y.flatConfigs.recommended,
files: ['src/**/*.{js,jsx}'],
};
export default [jsxChecks];
npx eslint --config eslint.a11y.config.mjs "src/**/*.{js,jsx}"
This configuration is deliberately limited to the plugin’s accessibility rules. Continue running the application’s regular lint checks as well. When merging the preset into a larger configuration, preserve the project’s parser and globals rather than replacing the whole configuration with the accessibility preset.
For Vue, use the Vue accessibility plugin’s maintained setup instructions, linked from its repository, with the application’s Vue-aware ESLint configuration. Include .vue files in the lint task. Do not substitute the JSX configuration above: the Vue plugin identifies Vue files as its input. Treat both lint integrations as source checks; the JSX maintainers explicitly recommend rendered-page and assistive-technology checks alongside linting.
Make labels and focus survive state changes
Start with the form that a visitor must complete. The archived React accessibility guide documents htmlFor in JSX; Vue’s accessibility guide uses for. Both associate the label with the input’s id. Vue also documents aria-describedby for supplementary instructions, which keeps the label and the explanation distinct.
For a single React form control:
<label htmlFor="react-email">Email</label>
<input id="react-email" type="email" aria-describedby="react-email-help" />
<p id="react-email-help">Use the address where you receive account messages.</p>
The equivalent Vue template markup:
<label for="vue-email">Email</label>
<input id="vue-email" type="email" aria-describedby="vue-email-help" />
<p id="vue-email-help">Use the address where you receive account messages.</p>
Choose distinct IDs when adding more instances. Keep instructions visible outside the input, as Vue recommends, instead of making in-field hints carry the explanation. During review, inspect the accessible name and description of the control, then check the same field while entering and correcting an invalid value.
For dialogs, connect dismissal to application state. In React Aria’s controlled pattern, pass the state setter to onOpenChange; use the dialog’s title heading to name it. The following is the integration shape inside a component that already owns open and setOpen:
<Modal isOpen={open} onOpenChange={setOpen} isDismissable>
<Dialog>
<Heading slot="title">Preferences</Heading>
<button type="button" onClick={() => setOpen(false)}>
Close preferences
</button>
</Dialog>
</Modal>
React Aria allows Escape dismissal by default. For Vue, Headless UI emits its close event for Escape and outside-panel clicks; update the controlling state when that event arrives. Its DialogTitle supplies the dialog’s accessible name. This Vue component supplies the trigger and state together:
<script setup>
import { ref } from 'vue';
import { Dialog, DialogPanel, DialogTitle } from '@headlessui/vue';
const open = ref(false);
function closePreferences() {
open.value = false;
}
</script>
<template>
<button type="button" @click="open = true">Open preferences</button>
<Dialog :open="open" @close="closePreferences">
<DialogPanel>
<DialogTitle>Preferences</DialogTitle>
<button type="button" @click="closePreferences">Close preferences</button>
</DialogPanel>
</Dialog>
</template>
Install the Vue component package with npm install @headlessui/vue and style the panel for your application. Headless UI documents focus containment while the dialog is open and an initialFocus ref for selecting the initial target. Verify that closing the dialog returns focus to its trigger, the behavior recommended by React’s accessibility guidance.
Focus repair also belongs outside overlays. Vue’s guide recommends a skip link and restoring focus before it on route changes. MDN’s React focus tutorial shows why edit-mode focus changes should follow a state transition rather than steal focus when the page first mounts. Add these transitions to the acceptance journey, especially where editing or deleting an item replaces the focused element.
Scan the page state the user reaches
Use Playwright’s documented axe integration in each application. Install the test packages, then install the browsers needed by your Playwright configuration:
npm install --save-dev @playwright/test @axe-core/playwright
npx playwright install
Save the following as tests/a11y.spec.js. Set A11Y_URL in the test environment to the running page you intend to scan. The dialog test assumes the page contains an Open preferences button and a dialog named Preferences, matching the Vue example; use those accessible names in the React trigger and dialog too.
import { test, expect } from '@playwright/test';
import AxeBuilder from '@axe-core/playwright';
const target = process.env.A11Y_URL;
if (!target) throw new Error('Set A11Y_URL to the running page under test');
async function checkPage(page, testInfo) {
const scan = await new AxeBuilder({ page })
.withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa'])
.analyze();
await testInfo.attach('axe-results', {
body: JSON.stringify(scan),
contentType: 'application/json',
});
expect(scan.violations).toEqual([]);
}
test('initial page accessibility', async ({ page }, testInfo) => {
await page.goto(target);
await checkPage(page, testInfo);
});
test('open preferences accessibility', async ({ page }, testInfo) => {
await page.goto(target);
await page.getByRole('button', { name: 'Open preferences' }).click();
await page.getByRole('dialog', { name: 'Preferences' }).waitFor();
await checkPage(page, testInfo);
});
Run npx playwright test tests/a11y.spec.js for each application. Add application-specific readiness waits before scanning asynchronous page content. Playwright documents that axe inspects the current state, so a scan made before the dialog or loaded form appears misses that state.
The tag list follows Playwright’s documented WCAG A and AA example, including wcag21a. A passing assertion means the selected automated checks returned no violations. Keep manual interaction review alongside it. The attachment preserves the complete axe result, including passed and inconclusive checks, for diagnosis.
For an existing backlog, avoid excluding an entire form just to silence a known issue. Playwright documents that exclude() removes the selected element and its descendants from every rule. Prefer fixing the affected control; where a temporary exception is necessary, keep its scope explicit and review it separately.
Turn Storybook findings into CI failures
In an existing Storybook project, Storybook’s accessibility testing documentation gives these commands to install the accessibility addon and its Vitest integration:
npx storybook add @storybook/addon-a11y
npx storybook add @storybook/addon-vitest
Merge this setting into the exported preview configuration in .storybook/preview.js, retaining the project’s other parameters:
export default {
parameters: {
a11y: {
test: 'error',
},
},
};
Run the configured Storybook Vitest tests in CI. Storybook explicitly requires parameters.a11y.test to be error for accessibility failures to produce CI errors. A story marked todo can show a warning locally while producing no accessibility error or output in CI. Use that setting only as a tracked exception for a component awaiting repair, then remove the exception after fixing it.
| Observed behavior | Documented explanation | Adjustment |
|---|---|---|
| Storybook shows an issue, but CI does not fail | todo does not produce accessibility failures in CI |
Set parameters.a11y.test to error for enforced stories |
| A story and a page scan differ on landmark coverage | Storybook disables the region rule by default |
Retain the complete-page scan alongside component checks |
| Storybook lists an Incomplete result | The check needs manual confirmation | Inspect the flagged content with the relevant manual check |
| A revealed panel is absent from scan findings | Axe scans the page state present when analyze() runs |
Open the panel and wait for it before scanning |
Keep both the page suite and the component suite in the release workflow. Our recommendation is to enforce them as required checks after addressing or explicitly isolating the existing backlog. For deployed pages, repeat the same state-based checks after changes to content or embedded UI; choose the schedule around how those pages change.
Use the failure data to prioritize repairs
The WebAIM Million report gives useful priorities for the markup review. In its February 2026 evaluation, 95.9% of home pages had detectable WCAG failures. The following categories from that report are directly relevant to the forms, images and navigation in a React or Vue application.
| Detected failure | Home pages affected |
|---|---|
| Low-contrast text | 83.9% |
| Missing image alternative text | 53.1% |
| Missing form input labels | 51% |
| Empty links | 46.3% |
| Any detected WCAG failure | 95.9% |
Start the repair pass with the colors used for text and backgrounds, input labels, image alternatives and link names. Where a shared component supplies these across the application, fix it there and rerun its stories and the affected pages. Use the failures found in your own application to refine that repair order.
| WebAIM sample | Home pages | Average detected errors per page |
|---|---|---|
| React | 45,673 | 43.5 |
| Vue.js | 55,049 | 64.6 |
| All sampled sites | 1,000,000 | 56.1 |
WebAIM warns against assigning technology-associated errors directly to the technology. These averages therefore offer no reason to expect a framework migration to repair your application. Tech Insider would put the work into the specific failing controls and shared components first, then use the same browser and interaction checks to judge the result in either framework.
Walk the keyboard journey before release
The React guidance on keyboard testing recommends using Tab and Shift+Tab to navigate, Enter to activate controls, and arrow keys where the widget requires them. It also calls for screen-reader testing and identifies NVDA with Firefox and VoiceOver with Safari as useful combinations.
- Enter through the page’s skip link and follow the visible focus indicator to the form.
- Read each field’s label and instructions, enter an invalid value, and verify that the error can be found and understood with the screen reader.
- Open the preferences dialog, move through its controls in both directions, then dismiss it with Escape and check the return focus.
- Repeat an edit, delete or route-change action and check that the next focus location still makes sense.
- Complete the real task, including its confirmation, without relying on a mouse or on visual feedback alone.
Include pointer-driven interactions such as drag-and-drop in that keyboard review. Follow React’s guidance to make pointer functionality available through the keyboard, and preserve a visible focus indicator. Vue’s guidance also cautions against applying aria-hidden to focusable controls.
Accept the implementation when the actual journey works: the visitor can identify the fields, correct an error, enter and leave the dialog, and continue after a state change. The React and Vue code will differ, but those are the same outcomes to require from each.




