How to install the Evolving Accessibility Widget
Before you start
- Your site key: it is in your order confirmation e-mail and in My Account under Sites.
- The address of your accessibility statement. Write one with our accessibility statement generator if you do not have one yet.
- Whether your website sends a Content Security Policy. Ask your developer or host if you are not sure.
Your installation code
Replace YOUR-SITE-KEY with your site key and the statement address with your own.
<script src="https://ada-expert-web.vercel.app/widget/v1/evolving.js"
data-site-key="YOUR-SITE-KEY"
data-position="left"
data-lang="auto"
data-statement-url="https://example.com/accessibility-statement/"
async></script>| Attribute | Values | Default |
|---|---|---|
| data-site-key | Your site key: letters, digits, hyphens and underscores, up to 64 characters. It works only on the website addresses of your plan | Required: without your own key the button is not shown |
| data-position | left or right | left |
| data-lang | auto, or a language code such as en or es | auto: the visitor's choice, else your page's language |
| data-statement-url | The address of your accessibility statement | None: the Accessibility Statement link is not shown |
| data-feedback-url | A mailto: or https: address where visitors can report barriers | None: the Send Feedback link is not shown |
| data-offset-x, data-offset-y | Distance of the button from the corner, 0 to 200 pixels | 20 (12 on small screens) |
| data-color | A #rrggbb color on which white text has a contrast of at least 4.5:1 (others are ignored) | #0048ff |
| data-shortcut | alt+shift+a, or off (also turns off Alt+Shift+R, which reads aloud from the focused element) | alt+shift+a |
| data-mobile | show or hide (the button only: saved adjustments still apply) | show |
| data-text-scale-mode | zoom, or root for websites whose text sizes are all set in rem | zoom |
Visitors' own choices (language, side and panel size) always win over these settings.
Where to paste it
In the <head> of every page: saved settings then apply as early as possible. Just before </body> works too.
If your pages show other pages of your own website in frames, add the code to those pages as well: settings do not reach into frames.
Step by step, by platform
Menus change: if a step looks different, follow the platform's current help article linked in each section.
WordPress
- With a plugin: install a plugin that adds code to the site header (search the plugin directory for “header and footer code”), paste the code into its header field and save.
- Or with a child theme: add the code to the
wp_headaction in your child theme'sfunctions.php, as in the example below. Never edit the parent theme: its updates overwrite your changes. - If you use a caching or optimization plugin, exclude
widget/v1/evolving.jsfrom its “delay JavaScript” and “combine JavaScript” options, then clear its cache.
<?php
// In your child theme's functions.php (never in the parent theme)
add_action( 'wp_head', function () {
?>
<script src="https://ada-expert-web.vercel.app/widget/v1/evolving.js"
data-site-key="YOUR-SITE-KEY"
data-statement-url="<?php echo esc_url( home_url( '/accessibility-statement/' ) ); ?>"
async></script>
<?php
} );WordPress.com websites need a plan that allows plugins or theme code.
Shopify
- In your Shopify admin, go to Online Store, then Themes. Next to your current theme, open the actions menu and choose Edit code.
- Open
layout/theme.liquid, paste the code just before</head>and save. - Repeat these steps whenever you publish a different theme.
Shopify's checkout pages do not load theme code, so the widget does not appear there.
Wix
- In your site's dashboard, go to Settings and choose Custom Code (under Development & integrations).
- Choose Add Custom Code, paste the code, choose All pages and Load code once, place it in Head, and apply.
Custom code needs a Premium plan with a connected domain.
Squarespace
- Open Code Injection in your site's settings (its place in the menu differs between dashboard versions: search the dashboard for “code injection”).
- Paste the code into the Header field and save.
Code injection is available on the Core, Plus and Advanced plans and some older plans.
Plain HTML and frameworks
- Paste the code into the
<head>your pages share: a common header include, or the base layout of your framework (for example the root layout in Next.js,baseof.htmlin Hugo or the base layout in Eleventy). - Keep the
data-attributes as they are; frameworks pass them through.
Google Tag Manager (optional)
- Create a Custom HTML tag with the code and the trigger All Pages, then publish the container.
- Tags load later than code in your theme, so saved settings apply a little later: prefer your theme or platform when you can.
Content Security Policy
If your website sends a Content-Security-Policy header, add ADA-Expert's address to these directives, next to the sources they already list:
script-src https://ada-expert-web.vercel.app;
connect-src https://ada-expert-web.vercel.app;
font-src https://ada-expert-web.vercel.app;
img-src https://ada-expert-web.vercel.app;The widget needs no 'unsafe-inline', no 'unsafe-eval' and no data: sources. It loads files only from that address and sets no cookies.
Optional: an accessibility settings button in your footer
Any element with the data-evolving-open attribute opens the panel, and focus returns to it when the panel closes. A button in your footer helps visitors find the settings again after hiding the accessibility button.
<button type="button" data-evolving-open>Accessibility settings</button>Check the installation
- The accessibility button appears on every page, in the corner you chose.
- It opens with Enter, the Tab key stays inside the panel, and Escape closes it.
- The Accessibility Statement link in the panel opens your own statement.
- The browser console shows no errors that start with [Evolving].
- Everything also works on a phone.
Troubleshooting
- The button does not appear
- Check that the code has your own site key instead of YOUR-SITE-KEY, that the website address matches the one on your plan (My Account → Sites) and that your plan is active; clear the cache of your caching or optimization plugin and exclude the script from JavaScript optimization; check that your Content Security Policy allows the widget; and make sure the code is pasted only once. The browser console explains the reason in a line that starts with [Evolving].
- Settings do not apply inside embedded frames
- Add the code to the pages inside the frames that you control. The widget cannot reach into frames from other websites.
- Text does not get larger
- If your website sets every text size in rem, add data-text-scale-mode="root" to the code.
Remove the widget
Delete the code from your website. Your visitors' saved adjustments stop applying at once.
What the widget does not do
The Evolving Accessibility Widget lets visitors adjust how your website looks and reads: text size, spacing, contrast, color, motion, focus outline and read-aloud. It does not change your website's code and does not, by itself, make a website conform to WCAG or meet the ADA. Conformance comes from an accessibility audit and fixes to the code, which ADA-Expert also provides.
