Widget Installation & Framework Integration
Step-by-step guide to installing the lightweight ~8 KB Accessibility Shield widget across HTML, Next.js, Astro, Hugo, React, Nuxt, WordPress, Webflow, and Shopify.
Add the snippet to your site
Pick your framework and paste the code into your project layout or custom code settings.
<!-- Accessibility Shield: hosted statement + barrier report form -->
<a href="https://accessibilityshield.org/statement/YOUR_SITE_ID">Accessibility statement</a>Strictly enforced via automated CI bundle budget tests so your site keeps a 100/100 Core Web Vitals score.
Complete keyboard trap prevention, ARIA dialog semantics, high-contrast mode, and instant visitor barrier reporting.
Native support for Astro, Next.js, Hugo, React, Nuxt, WordPress, Shopify, Webflow, or plain static HTML.
The simplest install is a footer link to your hosted accessibility statement, where visitors can read about your accessibility work and report a barrier. It needs no JavaScript: add the link, then click Verify in your dashboard's Accessibility Statement tab.
If you also want the floating toolbar, Accessibility Shield includes an ultra-lightweight on-site assistive toolbar (public/widget.js) designed to provide instant visual customizations (contrast toggles, text scaling, dyslexia-friendly fonts) and an integrated barrier reporting form for your website visitors.
Unlike bloated 300KB+ commercial overlays that inject tracking pixels, Accessibility Shield is compiled with pure vanilla TypeScript, enforces a strict 10 KB bundle budget (currently about 8 KB minified, about 3.3 KB gzipped), and loads asynchronously without delaying First Contentful Paint (FCP) or Largest Contentful Paint (LCP).
Technical Specifications
| Feature | Specification |
|---|---|
| Bundle Size | about 8 KB minified (about 3.3 KB gzipped) |
| Load Strategy | Asynchronous non-blocking (async / strategy="lazyOnload") |
| Runtime Dependencies | 0 external npm packages (pure vanilla DOM) |
| Storage & Privacy | No cookies. Visitor reading preferences are saved in their own browser (localStorage key as-p) and never sent to us |
| Keyboard Accessibility | Full WCAG 2.1 focus trapping, Escape to close, and ARIA dialog semantics |
| Supported Platforms | Any web application, SSG, SPA, or CMS |
Content Security Policy (CSP)
If your website uses a strict Content Security Policy (Content-Security-Policy HTTP header or <meta> tag), add our script and reporting endpoint origins to your directives:
Content-Security-Policy:
script-src 'self' https://accessibilityshield.org;
connect-src 'self' https://accessibilityshield.org;
style-src 'self' 'unsafe-inline';
script-src: Allows loading the widget script (widget.js).connect-src: Enables visitors to submit barrier reports toPOST https://accessibilityshield.org/api/report.style-src 'unsafe-inline': The ~8 KB widget injects isolated inline styles to render the floating action button and modal dialog without triggering extra stylesheet network roundtrips.
Verification & Troubleshooting
Once you have deployed the snippet:
- Verify Live: Visit your website in an incognito browser window. Look for the blue floating shield button in the bottom-right corner.
- Dashboard Verification: In your Accessibility Shield Dashboard, click Verify Widget. Our server-side scanner will inspect your homepage DOM and confirm active installation.
- Single Page Applications (SPAs): If your framework uses client-side page transitions (e.g. Astro View Transitions, Next.js App Router, or React Router), the widget automatically remains mounted in the DOM without requiring re-execution. For Astro, use
data-astro-rerunto ensure smooth re-initialization.
Need your Site ID or automated scan reports?
Register a domain on Accessibility Shield to access continuous weekly audits and automated compliance verification.