Logo

Menu.Item

A component to show a single list item inside a Menu.

Usage

import * as React from 'react';
import { View } from 'react-native';
import { Menu } from 'react-native-paper';

const MyComponent = () => (
  <View style={{ flex: 1 }}>
    <Menu.Item leadingIcon="redo" onPress={() => {}} title="Redo" />
    <Menu.Item leadingIcon="undo" onPress={() => {}} title="Undo" />
    <Menu.Item leadingIcon="content-cut" onPress={() => {}} title="Cut" disabled />
    <Menu.Item leadingIcon="content-copy" onPress={() => {}} title="Copy" disabled />
    <Menu.Item leadingIcon="content-paste" onPress={() => {}} title="Paste" />
  </View>
);

export default MyComponent;

Props

Type: React.ReactNode

Title text for the MenuItem.

leadingIcon
Renamed from 'icon' to 'leadingIcon' in v5.x

Leading icon to display for the MenuItem.

trailingIcon
Available in v5.x with theme version 3

Trailing icon to display for the MenuItem.

Type: boolean

Whether the 'item' is disabled. A disabled 'item' is greyed out and onPress is not called on touch.

dense
Available in v5.x with theme version 3
Type: boolean

Sets min height with densed layout.

Type: () => void

Function to execute on press.

Type: string

TestID used for testing purposes

Type: string

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

Edit this page