Skip to content

Astro

A script in your layout: Astro bundles it and runs it in the browser.

On this page

Install

npm install open-accessibility-widget

Usage

src/layouts/Layout.astro
<html lang="en">
  <body>
    <slot />
    <script>
      import { init } from "open-accessibility-widget";
      init({ position: "right" });
    </script>
  </body>
</html>

Notes

  • With view transitions, the widget re-attaches itself and re-applies the visitor's settings after each navigation.
  • Astro bundles script tags, so the import works without a client directive.

Accessibility statement

Pass statementUrl to link your accessibility statement from the panel's footer.

Edit this page on GitHub