Skip to content

Commit 4a139eb

Browse files
committed
Update tab navigator docs to include accessibilityLabel and testID
1 parent 31779c4 commit 4a139eb

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

docs/bottom-tab-navigator.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ React Element or a function that given `{ focused: boolean, tintColor: string }`
6565

6666
Title string of a tab displayed in the tab bar or React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Node, to display in tab bar. When undefined, scene `title` is used. To hide, see `tabBarOptions.showLabel` in the previous section.
6767

68+
#### `tabBarAccessibilityLabel`
69+
70+
Accessibility label for the tab button. This is read by the screen reader when the user taps the tab. It's recommended to set this if you don't have a label for the tab.
71+
72+
#### `tabBarTestID`
73+
74+
ID to locate this tab button in tests.
75+
6876
#### `tabBarOnPress`
6977

7078
Callback to handle tap events; the argument is an object containing:

docs/material-bottom-tab-navigator.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,22 @@ Color for the tab bar when the tab corresponding to the screen is active.
6161

6262
#### `tabBarLabel`
6363

64-
Title string of a tab displayed in the tab bar or React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Node, to display in tab bar. When undefined, scene `title` is used. To hide, see `tabBarOptions.showLabel` in the previous section.
64+
Title string of a tab displayed in the tab bar or React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Node, to display in tab bar. When undefined, scene `title` is used. To hide, see `tabBarOptions.showLabel` in the previous section.
65+
66+
#### `tabBarAccessibilityLabel`
67+
68+
Accessibility label for the tab button. This is read by the screen reader when the user taps the tab. It's recommended to set this if you don't have a label for the tab.
69+
70+
#### `tabBarTestID`
71+
72+
ID to locate this tab button in tests.
73+
74+
#### `tabBarOnPress`
75+
76+
Callback to handle tap events; the argument is an object containing:
77+
78+
* the `previousScene: { route, index }` which is the scene we are leaving
79+
* the `scene: { route, index }` that was tapped
80+
* the `jumpToIndex` method that can perform the navigation for you
81+
82+
Useful for adding a custom logic before the transition to the next scene (the tapped one) starts.

docs/material-top-tab-navigator.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ React Element or a function that given `{ focused: boolean, tintColor: string }`
7575

7676
Title string of a tab displayed in the tab bar or React Element or a function that given `{ focused: boolean, tintColor: string }` returns a React.Node, to display in tab bar. When undefined, scene `title` is used. To hide, see `tabBarOptions.showLabel` in the previous section.
7777

78+
#### `tabBarAccessibilityLabel`
79+
80+
Accessibility label for the tab button. This is read by the screen reader when the user taps the tab. It's recommended to set this if you don't have a label for the tab.
81+
82+
#### `tabBarTestID`
83+
84+
ID to locate this tab button in tests.
85+
7886
#### `tabBarOnPress`
7987

8088
Callback to handle tap events; the argument is an object containing:

0 commit comments

Comments
 (0)