Skip to content

Commit 61baa3c

Browse files
committed
Document DrawerItem props
1 parent 6f7c285 commit 61baa3c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/drawer-navigator.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ const styles = StyleSheet.create({
256256
});
257257
```
258258

259+
The `DrawerItem` component accepts the following props:
260+
261+
- `label` (required): The label text of the item. Can be string, or a function returning a react element. e.g. `({ focused, color }) => <Text style={{ color }}>{focused ? 'Focused text' : 'Unfocused text'}</Text>`.
262+
- `icon`: Icon to display for the item. Accepts a function returning a react element. e.g. `({ focused, color, size }) => <Icon color={color} size={size} name={focused ? 'heart' : 'heart-outline'} />`.
263+
- `focused`: Boolean indicating whether to highlight the drawer item as active.
264+
- `onPress` (required): Function to execute on press.
265+
- `activeTintColor`: Color for the icon and label when the item is active.
266+
- `inactiveTintColor`: Color for the icon and label when the item is inactive.
267+
- `activeBackgroundColor`: Background color for item when its active.
268+
- `inactiveBackgroundColor`: Background color for item when its inactive.
269+
- `labelStyle`: Style object for the label `Text`.
270+
- `style`: Style object for the wrapper `View`.
271+
259272
The `progress` node can be used to do interesting animations in your `contentComponent`, such as parallax motion of the drawer contents:
260273

261274
```js

0 commit comments

Comments
 (0)