You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`debug`|`boolean`|`false`| Log navigation decisions to the browser console. |
65
-
|`visualDebug`|`boolean`|`false`| Draw a canvas overlay showing component bounding boxes and navigation paths. |
66
-
|`nativeMode`|`boolean`|`false`|**Deprecated.** Disable DOM key event listeners (for React Native). You must drive navigation manually. |
67
-
|`throttle`|`number`|`0`| Milliseconds to wait between processing repeated key presses. `0` means no throttle. |
68
-
|`throttleKeypresses`|`boolean`|`false`| When `true` and `throttle > 0`, throttle key repeat events while a key is held down. |
69
-
|`useGetBoundingClientRect`|`boolean`|`false`| Use `getBoundingClientRect()` instead of `offsetLeft/Top` for layout measurement. Use this when elements are CSS-transformed or scaled. |
70
-
|`shouldFocusDOMNode`|`boolean`|`false`| Call `HTMLElement.focus()` on the focused component's DOM node, enabling native browser focus behavior and accessibility. |
71
-
|`domNodeFocusOptions`|`FocusOptions`|`undefined`| Options passed to `HTMLElement.focus()` when `shouldFocusDOMNode` is `true`. |
72
-
|`shouldUseNativeEvents`|`boolean`|`false`| Do not call `preventDefault()` on key events, allowing the browser to handle them natively as well. |
73
-
|`rtl`|`boolean`|`false`| Enable right-to-left layout mode. Left and right navigation directions are swapped. |
74
-
|`distanceCalculationMethod`|`'center' \| 'edges' \| 'corners'`|`'corners'`| Algorithm used to calculate distance between components. See [Distance Calculation](../guides/distance-calculation.md). |
75
-
|`customDistanceCalculationFunction`|`function`|`undefined`| Override the secondary-axis distance calculation. See [Distance Calculation](../guides/distance-calculation.md). |
|`debug`|`boolean`|`false`| Log navigation decisions to the browser console. |
65
+
|`visualDebug`|`boolean`|`false`| Draw a canvas overlay showing component bounding boxes and navigation paths. |
66
+
|`nativeMode`|`boolean`|`false`|**Deprecated.** Disable DOM key event listeners (for React Native). You must drive navigation manually. |
67
+
|`throttle`|`number`|`0`| Milliseconds to wait between processing repeated key presses. `0` means no throttle. |
68
+
|`throttleKeypresses`|`boolean`|`false`| When `true` and `throttle > 0`, throttle key repeat events while a key is held down. |
69
+
|`useGetBoundingClientRect`|`boolean`|`false`| Use `getBoundingClientRect()` instead of `offsetLeft/Top` for layout measurement. Use this when elements are CSS-transformed or scaled. |
70
+
|`shouldFocusDOMNode`|`boolean`|`false`| Call `HTMLElement.focus()` on the focused component's DOM node, enabling native browser focus behavior and accessibility. |
71
+
|`domNodeFocusOptions`|`FocusOptions`|`undefined`| Options passed to `HTMLElement.focus()` when `shouldFocusDOMNode` is `true`. |
72
+
|`shouldUseNativeEvents`|`boolean`|`false`| Do not call `preventDefault()` on key events, allowing the browser to handle them natively as well. |
73
+
|`rtl`|`boolean`|`false`| Enable right-to-left layout mode. Left and right navigation directions are swapped. |
74
+
|`distanceCalculationMethod`|`'center' \| 'edges' \| 'corners'`|`'corners'`| Algorithm used to calculate distance between components. See [Distance Calculation](../guides/distance-calculation.md). |
75
+
|`customDistanceCalculationFunction`|`function`|`undefined`| Override the secondary-axis distance calculation. See [Distance Calculation](../guides/distance-calculation.md). |
76
76
|`onUtterText`|`(text: string) => void`|`undefined`| Global callback invoked with a concatenated accessibility label string whenever focus changes. Wire this to your platform's Text-To-Speech engine. See the [Accessibility Labels](../guides/accessibility-labels.md) guide. |
|`Home` → `Inception`|`"Recommended, Movies, Inception"`| Entered `Content` and `Row 1` for the first time, plus the leaf label |
136
+
|`Inception` → `Interstellar`|`"Interstellar"`| Still inside `Row 1`; no new parent region entered — only the leaf label |
137
+
|`Interstellar` → `Breaking Bad`|`"Series, Breaking Bad"`| Left `Row 1` and entered `Row 2`; `Content` is unchanged, so it's skipped |
138
138
139
139
### When nothing is uttered
140
140
@@ -157,7 +157,13 @@ Prefer the concrete item over the element type. `"Play"` is more useful than `"B
157
157
`accessibilityLabel` is one of the few `useFocusable` options that _is_ reactive after mount. Passing a new value triggers an update; the next focus change on that component will use the new label. This is useful for toggles and counters:
158
158
159
159
```typescript
160
-
function Favorite({ title, isFavorited }: { title:string; isFavorited:boolean }) {
160
+
function Favorite({
161
+
title,
162
+
isFavorited
163
+
}: {
164
+
title:string;
165
+
isFavorited:boolean;
166
+
}) {
161
167
const { ref, focused } =useFocusable({
162
168
accessibilityLabel: isFavorited
163
169
?`Remove ${title} from favorites`
@@ -187,9 +193,9 @@ If you expect fast, repeated key presses (e.g. holding the arrow key), consider
|[`init({ onUtterText })`](../api-reference/SpatialNavigation.md#init-config)| Global callback fired with the text to be uttered when focus changes.|
193
-
|[`useFocusable({ accessibilityLabel })`](../api-reference/useFocusable.md#accessibilitylabel)| Per-component label. Set on both leaf items and containers. |
|[`init({ onUtterText })`](../api-reference/SpatialNavigation.md#init-config)| Global callback fired with the text to be uttered when focus changes.|
199
+
|[`useFocusable({ accessibilityLabel })`](../api-reference/useFocusable.md#accessibilitylabel)| Per-component label. Set on both leaf items and containers. |
194
200
195
201
See also: [`useFocusable`](../api-reference/useFocusable.md) and [`SpatialNavigation`](../api-reference/SpatialNavigation.md).
0 commit comments