useScreenReader
Detects active iOS VoiceOver and Android TalkBack screen readers with a live announcement helper.
v0.2.0NativeWindStyleSheetiOSAndroidExpo Go
Installation
npx nativra-cli add use-screen-readerWrites use-screen-reader.ts to hooks, rewrites imports to your aliases and records hashes in nativra.lock.json. Existing files are never overwritten without asking.
Want to try it first? Open it in the playground: a real React Native project in your browser, with this item installed by the CLI.
Usage
The useScreenReader hook tracks whether iOS VoiceOver or Android TalkBack is active (isEnabled) and exposes an announce(message) helper wrapping AccessibilityInfo.announceForAccessibility.
Installation
npx nativra-cli add use-screen-readerUsage
import { Pressable, Text } from "react-native";
import { useScreenReader } from "@/hooks/use-screen-reader";
export function SaveAction() {
const { isEnabled, announce } = useScreenReader();
return (
<Pressable
onPress={() => announce("Profile settings saved successfully")}
accessibilityRole="button"
>
<Text>{isEnabled ? "Save (Screen Reader Active)" : "Save"}</Text>
</Pressable>
);
}Source
Exactly what the CLI writes, before your import aliases are applied.