{"id":13445827,"url":"https://github.com/dequelabs/react-axe","last_synced_at":"2025-09-27T07:32:04.945Z","repository":{"id":55825476,"uuid":"58418545","full_name":"dequelabs/react-axe","owner":"dequelabs","description":"[DEPRECATED] Accessibility auditing for React.js applications","archived":true,"fork":false,"pushed_at":"2020-12-11T18:23:42.000Z","size":960,"stargazers_count":1155,"open_issues_count":1,"forks_count":45,"subscribers_count":21,"default_branch":"develop","last_synced_at":"2025-01-11T13:06:41.017Z","etag":null,"topics":["axe"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dequelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2016-05-10T01:00:06.000Z","updated_at":"2024-11-28T16:32:36.000Z","dependencies_parsed_at":"2022-08-15T07:30:47.996Z","dependency_job_id":null,"html_url":"https://github.com/dequelabs/react-axe","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Freact-axe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Freact-axe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Freact-axe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dequelabs%2Freact-axe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dequelabs","download_url":"https://codeload.github.com/dequelabs/react-axe/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234410314,"owners_count":18828174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axe"],"created_at":"2024-07-31T05:00:40.219Z","updated_at":"2025-09-27T07:31:54.934Z","avatar_url":"https://github.com/dequelabs.png","language":"TypeScript","readme":"# [DEPRECATED] react-axe\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n\u003e This repository has been deprecated. The package has been moved to [axe-core-npm](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/react). The package will be available via NPM as [`@axe-core/react`](https://www.npmjs.com/package/@axe-core/react).\n\n---\n\n# React-axe\n\nTest your React application with the [axe-core](https://github.com/dequelabs/axe-core) accessibility testing library. Results will show in the Chrome DevTools console.\n\n## Usage\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/dequelabs/react-axe.svg)](https://greenkeeper.io/)\n\nInstall the module from NPM or elsewhere\n\n```sh\nnpm install --save-dev react-axe\n```\n\n## Initialize the module\n\nCall the exported function passing in the React and ReactDOM objects as well as a timing delay in milliseconds that will be observed between each component change and the time the analysis starts.\n\n```js\nvar React = require('react');\nvar ReactDOM = require('react-dom');\n\nif (process.env.NODE_ENV !== 'production') {\n  var axe = require('react-axe');\n  axe(React, ReactDOM, 1000);\n}\n```\n\nBe sure to only run the module in your development environment (as shown in the code above) or else your application will use more resources than necessary when in production. You can use [envify](https://www.npmjs.com/package/envify) to do this as is shown in the [example](./example/package.json#L35).\n\nOnce initialized, the module will output accessibility defect information to the Chrome Devtools console every time a component updates.\n\n## Deduplicating\n\nreact-axe will deduplicate violations using the rule that raised the violation and the CSS selector and the failureSummary of the specific node. This will ensure that each unique issue will only be printed to the console once.\n\n## Debouncing\n\nThe third argument to the exported function is the number of milliseconds to wait for component updates to cease before performing an analysis of all the changes. The changes will be batched and analyzed from the closest common ancestor of all the components that changed within the batch. This generally leads to the first analysis for a dynamic application, analyzing the entire page (which is what you want), while subsequent updates will only analyze a portion of the page (which is probably also what you want).\n\n## Shadow DOM\n\nWith version 3.0.0, react-axe now runs accessibility tests inside of open Shadow DOM. You don't have to do anything special other than run react-axe on an component encapsulated with open Shadow DOM (as opposed to closed). For more information, see the [axe-core repo](https://github.com/dequelabs/axe-core).\n\n## Configuration\n\nThere is a fourth optional argument that is a configuration object for axe-core. Read about the object here: https://github.com/dequelabs/axe-core/blob/master/doc/API.md#api-name-axeconfigure\n\n```js\nvar config = {\n  rules: [\n    {\n      id: 'skip-link',\n      enabled: true\n    }\n  ]\n};\n\naxe(React, ReactDOM, 1000, config);\n```\n\nAxe-core's context object can be given as a fifth optional argument to specify which element should (and which should not) be tested. Read more from the Axe-core documentation: https://github.com/dequelabs/axe-core/blob/master/doc/API.md#context-parameter\n\n```js\nvar context = {\n  include: [['#preview']]\n};\n\naxe(React, ReactDOM, 1000, undefined, context);\n```\n\n## Run the example\n\nRun a build in the example directory and start a server to see React-aXe in action in the Chrome Devtools console (opens on localhost:8888):\n\n```sh\nnpm install\ncd example\nnpm install\nnpm install -g http-server\nnpm start\n```\n\n## Run the tests\n\nInstall dependencies in the root directory (which also installs them in the example directory) and then run the tests:\n\n```\nnpm install\nnpm test\n```\n\nTo debug tests in the Cypress application:\n\n```\nnpm run test:debug\n```\n\n## Compatibility\n\nreact-axe uses advanced console logging features and works best in the Chrome browser, with limited functionality in Safari and Firefox.\n\n## Advantages\n\nI have been asked how this is different from modules like react-a11y which test the jsx.\n\nThe main difference is that react-axe tests the accessibility of the rendered DOM. This is important because many accessibility issues exist at the intersection of the DOM and the CSS and unless you have a fully rendered DOM, you will get two sorts of inaccuracies:\n\n1. False negatives because of lacking information. Example is in order to test color contrast you must know the foreground and background colors, and\n1. False positives because the element being evaluated is not in its final state and the information to communicate this to the testing algorithm is not available. Example is an inert piece of code that will be augmented once it becomes active.\n\nIf you have nice clean code, number 2 will be negligible but number 1 will always be a concern.\n","funding_links":[],"categories":["Development","TypeScript","Uncategorized","⚛️ React"],"sub_categories":["WIP/Need Awesomeification","Uncategorized","React-specific libs:"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdequelabs%2Freact-axe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdequelabs%2Freact-axe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdequelabs%2Freact-axe/lists"}