AccessibilityProps
One set of accessibility props, on every view and on both platforms:
label, hint, role (ARIA's names), live, actions and ARIA's
aria-* state and value facts (see docs/accessibility.md).
Usage
Make an icon-only button accessible.
// Make an icon-only button accessible.
import { Pressable, Symbol, type AccessibilityProps } from 'kuito';
// An icon button needs words for a screen reader: callers pass them through.
function IconButton(props: AccessibilityProps & { icon: string; onPress: () => void }) {
return (
<Pressable role="button" label={props.label} hint={props.hint} onPress={props.onPress}>
<Symbol name={props.icon} size={22} />
</Pressable>
);
}
<IconButton icon="heart" label="Like" hint="Adds the song to your likes" onPress={() => {}} />;Type declaration
export interface AccessibilityProps extends AccessibilityNativeProps {
role?: Prop<Role>;
/** The screen reader action taken, by `name`. */
onAction?: (event: AccessibilityActionEvent) => void;
}Members 17
| Name | Type | Required | Description |
|---|---|---|---|
role | Prop<Role> | No | — |
onAction | (event: AccessibilityActionEvent) => void | No | The screen reader action taken, by name. |
accessible | Prop<boolean> | No | Makes the view one screen reader element, read as its label or its children's text. |
label | Prop<string> | No | What a screen reader says for the view. |
hint | Prop<string> | No | What happens when the view is activated, read after the label. |
actions | Prop<readonly AccessibilityAction[]> | No | Actions a screen reader offers; onAction receives the one taken. |
live | Prop<"off" | "polite" | "assertive"> | No | ARIA's aria-live: announces changes to the view's content, on iOS too. |
aria-disabled | Prop<boolean> | No | — |
aria-selected | Prop<boolean> | No | — |
aria-checked | Prop<boolean | "mixed"> | No | — |
aria-busy | Prop<boolean> | No | — |
aria-expanded | Prop<boolean> | No | — |
aria-valuemin | Prop<number> | No | — |
aria-valuemax | Prop<number> | No | — |
aria-valuenow | Prop<number> | No | — |
aria-valuetext | Prop<string> | No | — |
onAction — method signatures
Signatures
(event: AccessibilityActionEvent): voidParameters
| Name | Type | Required | Description |
|---|---|---|---|
event | AccessibilityActionEvent | Yes | — |
Returns
void
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.