Back to React Native Paper

Drawer.Item

docs/public/4.0/drawer-item.html

5.15.11.3 KB
Original Source

Drawer.Item

A component used to show an action item with an icon and a label in a navigation drawer.

Usage

js
import * as React from 'react';
import { Drawer } from 'react-native-paper';

const MyComponent = () => (
   <Drawer.Item
     style={{ backgroundColor: '#64ffda' }}
     icon="star"
     label="First Item"
   />
);

export default MyComponent;

Props

label (required) Type: string

The label text of the item.

icon Type: IconSource

Icon to display for the DrawerItem.

active Type: boolean

Whether to highlight the drawer item as active.

onPress Type: () => void

Function to execute on press.

accessibilityLabel Type: string

Accessibility label for the button. This is read by the screen reader when the user taps the button.

right Type: (props: { color: string }) => React.ReactNode

Callback which returns a React element to display on the right side. For instance a Badge.

style Type: StyleProp<ViewStyle>

theme Type: ReactNativePaper.Theme

Edit this page