react native paper

React Native Paper

If you are developing a mobile app using React Native, then you might have come across the need to use a UI library. One of the popular options is React Native Paper.

React Native Paper is a UI library for React Native that follows Material Design guidelines. It provides a set of ready-to-use components that you can use to build your app quickly and easily. Some of the components provided by React Native Paper include buttons, cards, dialogs, and text fields.


To use React Native Paper in your project, you need to install it first. You can use either npm or yarn to install it.

npm install react-native-paper


yarn add react-native-paper


Once you have installed React Native Paper, you can start using its components in your app. First, you need to import the components that you want to use.

import { Button, Card, Dialog, TextInput } from 'react-native-paper';

Then, you can use these components in your app's render method.

render() {
  return (
      <Button mode="contained" onPress={() => console.log('Pressed')}>
        Press me
        <Card.Title title="Card Title" subtitle="Card Subtitle" />
          <Paragraph>Card content goes here.</Paragraph>
      <Dialog visible={this.state.visible} onDismiss={() => this.setState({ visible: false })}>
        <Dialog.Title>Dialog Title</Dialog.Title>
          <TextInput label="Email" value={} onChangeText={email => this.setState({ email })} />
          <TextInput label="Password" value={this.state.password} onChangeText={password => this.setState({ password })} secureTextEntry />
          <Button onPress={() => this.setState({ visible: false })}>Cancel</Button>
          <Button onPress={() => console.log('Pressed')}>Ok</Button>

The above code will render a button, a card, and a dialog component. You can customize the components by passing props to them.


React Native Paper provides a theming system that allows you to customize the look and feel of your app easily. You can define your own theme by creating a theme object and passing it to the Provider component.

import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';

const theme = {
  colors: {
    primary: 'red',
    accent: 'yellow',

render() {
  return (
    <PaperProvider theme={theme}>
      <App />

The above code will create a new theme with red as the primary color and yellow as the accent color. You can then use the theme in your app by wrapping it with the PaperProvider component.

In conclusion, React Native Paper is a great library that can help you build beautiful and functional UIs for your React Native app. Its components are easy to use and customize, and its theming system allows you to create a consistent look and feel across your app.

Subscribe to The Poor Coder | Algorithm Solutions

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]