It’s the principle of designing and developing websites in a way that they can be used by anyone, regardless of their abilities or disabilities, and the technology they use to access the web.
Source: GPT-3.5
It’s the principle of designing and developing websites in a way that they can be used by anyone, regardless of their abilities or disabilities, and the technology they use to access the web.
Source: GPT-3.5
WCAG, or Web Content Accessibility Guidelines, are standards developed by W3C. The guidelines are organized under 4 principles: perceivable, operable, understandable, and robust.
For each guideline, there are testable success criteria. The success criteria are at three levels: A, AA, and AAA.
Default zoom
Text only zoom
A screen reader is a software application that converts on-screen text and visual elements into spoken words or Braille output, allowing visually impaired or blind individuals to use computers and mobile devices.
Chart source: assistivlabs.com
eslint-plugin-jsx-a11y
) can help you to detect a11y issues while coding;Via a browser extension (axe DevTools)
Via React Testing Library
import { render } from "@testing-library/react";
import { axe } from "jest-axe";
import { Button } from "./Button";
test("Button a11y", async () => {
const { container } = render(<Button>Click me</Button>);
const results = await axe(container);
expect(results).toHaveNoViolations();
});
storybook-addon-a11y
to check the a11y of each story (it relies on axe-core).test('Menu keyboard interaction', async () => {
render(<Menu />);
const button = screen.getByRole("button", { name: "Dashboard" });
expect(button).toHaveAttribute("aria-expanded", "false");
await userEvent.keyboard("{tab}");
await userEvent.keyboard("{enter}");
expect(button).toHaveAttribute("aria-expanded", "true");
expect(screen.getByRole("menuitem", { name: "Profile" })).toHaveFocus();
await userEvent.keyboard("{arrowdown}");
expect(screen.getByRole("menuitem", { name: "My account" })).toHaveFocus();
await userEvent.keyboard("{Escape}");
expect(button).toHaveFocus();
expect(button).toHaveAttribute("aria-expanded", "false");
});