@accesspath/core
v0.1.5
Published
Framework-agnostic accessibility widget engine: state, panel UI, effects, and a built-in WCAG scanner.
Maintainers
Readme
@accesspath/core
Framework-agnostic accessibility widget engine: state, panel UI, effects, and a built-in WCAG
scanner. Zero framework dependencies, plain DOM. This is the engine used by
@accesspath/embed,
@accesspath/react, and
@accesspath/angular — most consumers
should use one of those instead of calling this package directly.
AI assistant / coding agent? Full copy-paste reference: https://accesspath-6ur.pages.dev/llms-full.txt
Install
npm install @accesspath/coreUsage
import { getState, createPanel, applyClasses } from '@accesspath/core';
import '@accesspath/core/styles/a11y-effects.css';
import '@accesspath/core/styles/panel.css';
const container = document.body; // element the a11y-* effect classes apply to
const state = getState('accesspath-prefs');
const panel = createPanel({ state, container });
document.documentElement.appendChild(panel.root); // never a descendant of `container`
state.subscribe(() => applyClasses([container], state.prefs, state.activeProfiles));
applyClasses([container], state.prefs, state.activeProfiles);
state.open();ESM-only; requires a bundler or a type: module environment.
