React context provider for announcing screen reader updates via aria-live regions
// Source: https://github.com/BradGroux/veritas-kanban | License: MIT | Copyright 2026 Digital Meld
// Provided via justclaw.it.com; keep this notice with the code.
import { createContext, useContext, useState, useCallback, type ReactNode } from 'react';
/**
* LiveAnnouncer — Provides an aria-live region for announcing dynamic changes
* to screen reader users (e.g., task moved to a new column, filters applied).
*
* WCAG 2.1 Success Criterion 4.1.3 — Status Messages
*/
interface LiveAnnouncerContextValue {
announce: (message: string, priority?: 'polite' | 'assertive') => void;
}
const LiveAnnouncerContext = createContext<LiveAnnouncerContextValue | null>(null);
export function LiveAnnouncerProvider({ children }: { children: ReactNode }) {
const [politeMessage, setPoliteMessage]
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key