Streaming responses
Group partial output into meaningful updates instead of sending every token or the growing transcript to a live region.
Screen readers and streaming AIAccessibility for AI interfaces
Give screen-reader users useful updates as responses stream, tools run, and decisions need attention.
npm install @generative-a11y/Existing application UI
Your assistant response will stream here while the library leaves this interface unchanged.
Screen-reader updates
Latest resultPress Play to run the visual trace
This trace shows each update core prepares. Test with a real screen reader to confirm what it speaks.
How it works
An adapter reports a response, tool, approval, or error. Core chooses the text and timing. DOM adds the update to the page.
Designed for asynchronous AI
Group partial output into meaningful updates instead of sending every token or the growing transcript to a live region.
Screen readers and streaming AIPrioritize confirmed tool progress, approval requests, interruptions, failures, retries, and connection changes.
Accessible AI agentsConnect documented lifecycle state from React, the Vercel AI SDK, assistant-ui, or AG-UI without replacing the host UI.
The accessibility layer
Streaming AI interfaces can change faster than a screen reader can present useful information. Sending each token to an ARIA live region creates repeated fragments, while replacing the full answer can make assistive technology announce growing text more than once. Agents add tool progress, approval requests, connection changes, failures, and retries that compete with response text.
generative-a11y accepts confirmed lifecycle events from your app, groups response text into meaningful units, prioritizes status updates, removes duplicates, and sends bounded announcement intents to the DOM package. The browser layer updates live regions without moving focus during normal streaming or tool activity. Your visual interface, semantic HTML, keyboard behavior, and application state remain under your control. Read the ARIA live region guide or review the accessibility model.
Quick start
Install core and DOM, create one runtime, and dispatch the events from your existing response and tool callbacks.
Read Getting Startedimport { createGenerativeA11y } from "@generative-a11y/core";
import { connectRuntimeToDOM } from "@generative-a11y/dom";
const runtime = createGenerativeA11y({});
const delivery = connectRuntimeToDOM(runtime);
runtime.dispatch({
type: "response.started",
responseId: "response-1",
});Packages: core, dom, react, ag-ui, ai-sdk, assistant-ui.
Built for: streaming, tools, approvals, retries, and clear status updates.
Browser matrix: Chromium, Firefox, and WebKit.
Development: redacted trace explorer and deterministic replay tests.
License: MIT.