Back to AccessPath Developer docs

Integration Guide

A complete walkthrough of every integration option for adding AccessPath to your website: the vanilla JavaScript embed, the React component and hook, and the Angular component, all built on one shared accessibility core.

Vanilla JS / HTML

Overview#

Add AccessPath to any website by dropping in a single script tag. It works on WordPress, Shopify, a static HTML site, or anywhere you can paste a snippet of HTML. The script reads its own data-* attributes, mounts a floating trigger and drawer inside a Shadow DOM root, and injects both core stylesheets automatically, so there is no separate CSS file to include.

Wrap the part of the page you want AccessPath to affect in a container element. It defaults to <body>, or you can point it at a different element with data-target. This container is what receives the a11y-* effect classes. The panel and floating trigger always mount at the document root, outside that container, so effects like saturation or color inversion never visually apply to the panel's own interface.

Installation#

HTML
<script src="/embed.js"
        data-theme="light"
        data-storage-key="accesspath-prefs"
        data-position="bottom-right"
        data-shape="circle"
        data-icon="accessibility"
        data-draggable="true"
        data-brand="#4928F3">
</script>

data-* attributes#

AttributeValuesDefaultDoes
data-themelight / darklightDrawer chrome theme.
data-storage-keyany stringaccesspath-prefslocalStorage key; instances sharing a key share state.
data-targetCSS selectordocument.bodyElement the a11y-* classes apply to.
data-positionbottom-right / bottom-left / top-right / top-leftbottom-rightCorner the floating trigger docks to.
data-shapecircle / rounded-square / pillcircleTrigger button shape.
data-iconaccessibility / motion / contrast / spacing / motor / badge / logoaccessibilityTrigger button icon. If you need a custom SVG icon, use the core, React, or Angular integration instead, since a DOM element cannot travel through a data attribute.
data-draggabletrue / falsefalseLets the visitor drag the trigger; its dropped position is remembered per storageKey.
data-brandhex colorAccessPath violetOverrides the --ap-brand-* token set.
data-profilescomma list of profile keysall 6Restricts which preset profile pills render.
data-sectionscomma list: profiles,quick,controls,actionsall 4, that orderWhich top-level drawer sections render, and in what order.
data-control-categoriescomma list: vision,content,motion,reading,navigationall 5Which built-in category groups render inside "controls".
data-localeen / es / fr / de / ptenBundled translation set for every panel string.
data-labelsJSON objectNonePer-string overrides layered on top of data-locale. Same nested shape as the Labels type.
data-actionsJSON array of {"id","label","icon?","ariaLabel?"}NoneCustom buttons in the drawer's Actions section.
data-hide-triggertrue / falsefalseSkips the floating trigger. Open the drawer from your own button via window.AccessPath below.

Scripting & events#

The embed exposes one page-global for hosts that want to open the drawer from their own UI, or listen for custom action clicks:

JS
window.AccessPath.open();
window.AccessPath.close();
window.AccessPath.toggle();

// data-actions='[{"id":"support","label":"Contact support"}]'
document.body.addEventListener('accesspath:action', (e) => {
  if (e.detail.id === 'support') { /* ... */ }
});

The event fires on whatever element data-target resolves to, which is document.body by default. Listen for it there, not on window.AccessPath itself.