DOM
@generative-a11y/dom
Browser announcements, runtime connections, safe focus helpers, attention tracking, and validated preference storage.
Install browser delivery
DOM uses core without depending on React or an AI framework.
shell
npm install @generative-a11y/core @generative-a11y/domHow this code works
- 01Prepare updates in core
Core prepares announcements without using browser globals.
- 02Add updates to the page
DOM uses ariaNotify when available and falls back to hidden live regions.
Public export map
Choose direct announcing or bind an existing runtime.
| Category | Exports | Reference |
|---|---|---|
| Delivery | createDOMAnnouncer | /api/dom/create-dom-announcer |
| Runtime binding | connectRuntimeToDOM | /api/dom/connect-runtime-to-dom |
| Focus | captureFocus, focusElement, restoreFocus | /api/dom/focus |
| Attention | createAttentionStore | /api/dom/attention |
| Preferences | createPreferenceStore and mapping helpers | /api/dom/preferences |