accessibility
Adapts the app to assistive technology: whether a screen reader runs or the user prefers reduced motion, and speaking or moving focus for them.
Verwendung
Respond to screen reader and motion settings
import { Pressable, Text, accessibility, ref, signal, watch } from 'kuito';
export function Results() {
const title = ref();
const animations = signal(true);
accessibility.announce('12 shows found');
accessibility.announce('Saved', { queue: true });
watch(accessibility.reduceMotion, (calm) => {
animations.value = !calm;
});
return (
<Pressable onPress={() => title.current && accessibility.focus(title.current)}>
<Text ref={title}>{accessibility.screenReader.value ? 'Screen reader on' : 'Results'}</Text>
</Pressable>
);
}Exporte 4
Methoden, Konstanten und Typen, die dieser native Namespace bereitstellt.
value
screenReaderWhether VoiceOver or TalkBack is on; null until the platform first answers.valuereduceMotionWhether the user asked for less motion; null until the platform first answers.functionannounceThe screen reader reads message, interrupting what it is saying; with
queue: true it waits for current speech (iOS; Android always queues).functionfocusMoves the screen reader's focus to a mounted element, such as ref.current.Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.