React Native Paper Menu Example

May 17, 2021 . Admin

Hi Guys,

Today, I will learn you how to engender paper menu in react native. You can facilely engender paper menu in react native. First i will import stylesheet namespace from react-native-paper, after I will make paper menu utilizing in react native.

Here, I will give you full example for simply exhibit paper menu utilizing react native as bellow.

Step 1 - Create project

In the first step Run the following command for create project.

expo init PaperMenu
Step 2 - Install Package

In the step,I will install npm i react-native-paper package.

npm i react-native-paper
Step 3 - App.js

In this step, You will open App.js file and put the code.

import React, { Component } from "react";
import { Text, View,StyleSheet} from 'react-native';
import { Provider ,Appbar,Card,menu} from 'react-native-paper';

const MyWebtutsComponent = () => {

   const [searchQuery, setSearchQuery] = React.useState('');

  const onChangeSearch = query => setSearchQuery(query);

  const _goBack = () => console.log('Went back');

  const _handleSearch = () => console.log('Searching');

  const _handleMore = () => console.log('Shown more');

  return (
    <Appbar.Header style={styles.header}>
      <Appbar.BackAction onPress={_goBack} />
      <Appbar.Content title="User" subtitle="Subtitle" />
      <Appbar.Action icon="magnify" onPress={_handleSearch} />
      <Appbar.Action icon="dots-vertical" onPress={_handleMore} />
      <View style={styles.mainbox}>

const styles = StyleSheet.create({
    margin: 10,
    fontSize: 15,
    fontSize: 35
    margin: 15,
    flex: 1,
    justifyContent: 'space-between',
    margin: 10,
    textAlign: 'center',
    margin: 10,
    textAlign: 'left', 
export default MyWebtutsComponent;
Step 4 - Run project

In the last step run your project using bellow command.

npm start

It will help you...

#React Native