File tree 1 file changed +46
-3
lines changed
1 file changed +46
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
A Gatsby plugin to add ` @axe-core/react ` accessibility testing to Gatsby markup.
4
4
5
- ## Installation
5
+ ## Install
6
6
7
7
``` shell
8
- yarn install @axe-core/react axe-core gatsby-plugin-axe-core-react --dev
9
- ```
8
+ yarn add @axe-core/react axe-core gatsby-plugin-axe-core-react --dev
9
+ ```
10
+
11
+ ## How to use
12
+
13
+ ``` javascript
14
+ // In your gatsby-config.js
15
+
16
+ plugins: [` gatsby-plugin-axe-core-react` ]
17
+ ```
18
+
19
+ or
20
+
21
+ ``` javascript
22
+ // In your gatsby-config.js
23
+
24
+ plugins: [
25
+ {
26
+ resolve: ' gatsby-plugin-axe-core-react' ,
27
+ options: {
28
+ axeConfig,
29
+ axeContext,
30
+ debounce,
31
+ },
32
+ },
33
+ ]
34
+ ```
35
+
36
+ React-axe will now print a11y warnings to your browser's console. 🎉
37
+
38
+
39
+ ### Configuration options
40
+ You can use the following options if you wish to to override the default config.
41
+
42
+ [ ** ` axeConfig ` ** ] ( https://www.npmjs.com/package/@axe-core/react#configuration ) [ object] [ optional ]
43
+
44
+ The configuration object for axe-core.
45
+
46
+ [ ** ` axeContext ` ** ] ( https://github.com/dequelabs/axe-core/blob/master/doc/API.md#context-parameter ) [ object] [ optional ]
47
+
48
+ Used to specify which element should and which should not be tested.
49
+
50
+ [ ** ` debounce ` ** ] ( https://www.npmjs.com/package/@axe-core/react#debouncing ) [ number] [ optional ]
51
+
52
+ The number of milliseconds to wait for component updates to cease before performing an analysis of all the changes.
You can’t perform that action at this time.
0 commit comments