Skip to content

Svelte

Start it in onMount in your root layout; the function it returns removes the widget.

On this page

Install

npm install open-accessibility-widget

Usage

+layout.svelte
<script>
  import { onMount } from "svelte";
  import { init } from "open-accessibility-widget";

  onMount(() => {
    const widget = init({ position: "right" });
    return () => widget.destroy();
  });
</script>

<slot />

Notes

  • In SvelteKit, onMount runs only in the browser.
  • Put it in the root +layout.svelte so it stays across pages.

Accessibility statement

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

Edit this page on GitHub