@@ -9,7 +9,6 @@ The TanStack Devtools Accessibility (A11y) Plugin provides real-time accessibili
99
1010- ** Full Page Scanning** - Audit your entire page for accessibility violations
1111- ** Component-Level Scanning** - Scope audits to specific components using React hooks
12- - ** Live Monitoring** - Automatically re-scan when the DOM changes
1312- ** Visual Overlays** - Highlight problematic elements with severity-based colors
1413- ** Click-to-Navigate** - Click on an issue to automatically scroll to and highlight the element
1514- ** Dark Mode Support** - Automatically adapts to the devtools theme
@@ -87,25 +86,21 @@ Initial configuration can be provided via the vanilla plugin API:
8786import { createA11yPlugin } from ' @tanstack/devtools-a11y'
8887
8988const plugin = createA11yPlugin ({
89+ threshold: ' serious' ,
9090 ruleSet: ' wcag21aa' ,
91- threshold: ' moderate' ,
92- runOnMount: true ,
93- liveMonitoring: true ,
94- liveMonitoringDelay: 1000 ,
9591 showOverlays: true ,
92+ persistSettings: true ,
93+ disabledRules: [],
9694})
9795```
9896
9997Common ` options ` fields:
10098
10199- ` threshold ` : minimum impact level to show
102100- ` ruleSet ` : rule preset (` 'wcag2a' | 'wcag2aa' | 'wcag21aa' | 'wcag22aa' | 'section508' | 'best-practice' | 'all' ` )
103- - ` disabledRules ` : rule IDs to ignore
104101- ` showOverlays ` : highlight issues in the page
105- - ` runOnMount ` : auto-scan when panel mounts
106102- ` persistSettings ` : store config in localStorage
107- - ` liveMonitoring ` : watch DOM mutations and re-scan automatically
108- - ` liveMonitoringDelay ` : debounce delay (ms)
103+ - ` disabledRules ` : rule IDs to ignore
109104
110105If you don't need to provide initial configuration, you can use the framework plugin helpers
111106directly (the settings UI persists changes to localStorage by default).
@@ -126,36 +121,6 @@ Issues are categorized by impact level with corresponding overlay colors:
126121The panel UI is implemented in Solid and wrapped for React, Solid, Preact, and Vue
127122using ` @tanstack/devtools-utils ` .
128123
129- ## Vanilla JavaScript API
130-
131- For non-React applications, ` createA11yPlugin() ` exposes a small programmatic API in addition to the TanStack Devtools ` render() ` integration:
132-
133- ``` ts
134- import { createA11yPlugin } from ' @tanstack/devtools-a11y'
135-
136- const plugin = createA11yPlugin ({
137- ruleSet: ' wcag21aa' ,
138- liveMonitoring: true ,
139- showOverlays: true ,
140- })
141-
142- // Run a scan
143- const result = await plugin .scan ?.()
144-
145- // Subscribe to scan results (manual or live)
146- const unsubscribe = plugin .onScan ?.((next ) => {
147- console .log (' Issues found:' , next .issues .length )
148- })
149-
150- // Control live monitoring
151- plugin .startLiveMonitoring ?.()
152- plugin .stopLiveMonitoring ?.()
153-
154- // Clean up
155- unsubscribe ?.()
156- plugin .destroy ?.()
157- ```
158-
159124## Export Formats
160125
161126### JSON Export
@@ -184,52 +149,6 @@ The plugin supports the following accessibility standards:
184149- ** Section 508**
185150- ** Best Practices** (non-standard recommendations)
186151
187- ## Types
188-
189- ``` ts
190- interface A11yIssue {
191- id: string
192- ruleId: string
193- impact: ' critical' | ' serious' | ' moderate' | ' minor'
194- description: string
195- help: string
196- helpUrl: string
197- selector: string
198- html: string
199- failureSummary: string
200- tags: string []
201- }
202-
203- interface A11yAuditResult {
204- timestamp: number
205- url: string
206- standard: string
207- issues: A11yIssue []
208- passes: number
209- violations: number
210- incomplete: number
211- scanDuration: number
212- }
213-
214- interface A11yConfig {
215- standard: string
216- liveMonitoring: boolean
217- showOverlays: boolean
218- scopedMode: boolean
219- scopeSelector? : string
220- excludeSelectors: string []
221- includeRules: string []
222- excludeRules: string []
223- }
224- ```
225-
226- ## Performance Considerations
227-
228- - ** Live monitoring** uses a debounced MutationObserver to avoid excessive re-scanning
229- - ** Scoped scanning** is recommended for large pages to reduce scan time
230- - ** Exclude selectors** can skip third-party widgets or known-good sections
231- - The first scan may be slower as axe-core initializes
232-
233152## Troubleshooting
234153
235154### Issues not appearing
@@ -244,12 +163,6 @@ interface A11yConfig {
2441632 . Check for CSS conflicts with ` z-index ` or ` pointer-events `
2451643 . Ensure the container element exists in the DOM
246165
247- ### Performance issues
248-
249- 1 . Disable live monitoring for large/complex pages
250- 2 . Use scoped scanning to limit the audit area
251- 3 . Increase the debounce delay for live monitoring
252-
253166## Example
254167
255168See the full working example at:
0 commit comments