add skip navigation, page title, and global ARIA live region

This commit is contained in:
Your Name
2026-02-19 19:45:51 +02:00
parent 19f794bc45
commit 739a9cee99
3 changed files with 36 additions and 1 deletions

19
src/hooks/useAnnounce.ts Normal file
View File

@@ -0,0 +1,19 @@
import { create } from "zustand";
interface AnnounceState {
message: string;
announce: (text: string) => void;
}
export const useAnnounceStore = create<AnnounceState>((set) => ({
message: "",
announce: (text) => {
// Clear first to ensure re-announcement of identical messages
set({ message: "" });
requestAnimationFrame(() => set({ message: text }));
},
}));
export function useAnnounce() {
return useAnnounceStore((s) => s.announce);
}