@itzsa/a11y-toolbar
Site preference panel for text size, contrast, spacing, motion, and related reading aids. Preferences persist in localStorage and apply via CSS under [data-a11y-content]. The floating control on this site is the live demo.
pnpm add @itzsa/a11y-toolbarAttributes are set on <html>. Effects only run inside an SSR data-a11y-content wrapper — do not add that wrapper only after hydration or FOUC prevention will fail.
import { A11yToolbar } from "@itzsa/a11y-toolbar";
import { getA11yFoucScript } from "@itzsa/a11y-toolbar/headless";
import "@itzsa/a11y-toolbar/styles.css";
// 1. FOUC script in <head> (Server Component–safe import)
<script dangerouslySetInnerHTML={{ __html: getA11yFoucScript() }} />
// 2. SSR content root — required for FOUC + scoped effects
<main data-a11y-content>{children}</main>
// 3. Mount once from a Client Component, outside the content root
<A11yToolbar
position="bottom-right"
offset="1.25rem"
launcherSize="3.5rem"
theme={{
accent: "var(--accent)",
header: "var(--accent)",
headerForeground: "var(--accent-fg)",
launcher: "var(--accent)",
launcherForeground: "#ffffff",
launcherRing: "#ffffff",
fontFamily: 'var(--font-outfit), "Outfit", system-ui, sans-serif',
}}
/>hotkey={null} to disable — document overrides if AT or extensions claim the combo.prefers-reduced-motion.zoom so Tailwind utilities scale; Bigger Cursor uses a 32×32 SVG cursor.position and theme (itzsa accent, Outfit font) so the toolbar tracks your brand tokens.Use the floating accessibility button (bottom-right), or press Alt+A. Changes apply to this page's content immediately.