Widget Installation & Framework Integration
Step-by-step guide to installing the lightweight ~5KB 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 Widget (~5KB, loads asynchronously) -->
<script
src="https://accessibilityshield.org/widget.js"
data-site-id="YOUR_SITE_ID"
async
></script>Zero bloat. 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.
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 < 6.0 KB bundle budget (~5KB minified, ~2KB gzipped), and loads asynchronously without delaying First Contentful Paint (FCP) or Largest Contentful Paint (LCP).
Technical Specifications
| Feature | Specification |
|---|---|
| Bundle Size | 5.0 KB minified (~2.0 KB gzipped / brotli) |
| Load Strategy | Asynchronous non-blocking (async / strategy="lazyOnload") |
| Runtime Dependencies | 0 external npm packages (pure vanilla DOM) |
| Storage & Privacy | User display preferences are saved only in client localStorage |
| 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 ~5KB 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.