Convert Figma logo to code with AI

callstack logoreact-native-paper

Material Design for React Native (Android & iOS)

12,711
2,072
12,711
283

Top Related Projects

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Cross-Platform React Native UI Toolkit

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.

UI Components Library for React Native

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode

4,895

Customizable set of components for React Native applications

Quick Overview

React Native Paper is a collection of customizable and production-ready components for React Native, following Google's Material Design guidelines. It provides a consistent look and feel across Android and iOS platforms, making it easier for developers to create visually appealing and functional mobile applications.

Pros

  • Comprehensive set of pre-built, customizable components
  • Follows Material Design guidelines for a modern, consistent UI
  • Regular updates and active community support
  • Seamless integration with React Native projects

Cons

  • May require additional configuration for optimal performance on iOS
  • Some components might not perfectly match native platform look and feel
  • Learning curve for developers new to Material Design principles
  • Potential increase in app bundle size due to additional dependencies

Code Examples

  1. Using a Button component:
import * as React from 'react';
import { Button } from 'react-native-paper';

const MyComponent = () => (
  <Button icon="camera" mode="contained" onPress={() => console.log('Pressed')}>
    Press me
  </Button>
);

export default MyComponent;
  1. Creating a custom theme:
import * as React from 'react';
import { Provider as PaperProvider, DefaultTheme } from 'react-native-paper';

const theme = {
  ...DefaultTheme,
  colors: {
    ...DefaultTheme.colors,
    primary: 'tomato',
    accent: 'yellow',
  },
};

export default function Main() {
  return (
    <PaperProvider theme={theme}>
      {/* Your app content */}
    </PaperProvider>
  );
}
  1. Using a DataTable component:
import * as React from 'react';
import { DataTable } from 'react-native-paper';

const MyComponent = () => (
  <DataTable>
    <DataTable.Header>
      <DataTable.Title>Dessert</DataTable.Title>
      <DataTable.Title numeric>Calories</DataTable.Title>
      <DataTable.Title numeric>Fat</DataTable.Title>
    </DataTable.Header>

    <DataTable.Row>
      <DataTable.Cell>Frozen yogurt</DataTable.Cell>
      <DataTable.Cell numeric>159</DataTable.Cell>
      <DataTable.Cell numeric>6.0</DataTable.Cell>
    </DataTable.Row>

    {/* Add more rows as needed */}
  </DataTable>
);

export default MyComponent;

Getting Started

To start using React Native Paper in your project:

  1. Install the library:

    npm install react-native-paper
    
  2. Wrap your app with the PaperProvider component:

    import * as React from 'react';
    import { Provider as PaperProvider } from 'react-native-paper';
    import App from './src/App';
    
    export default function Main() {
      return (
        <PaperProvider>
          <App />
        </PaperProvider>
      );
    }
    
  3. Start using components in your app:

    import * as React from 'react';
    import { Appbar, Button } from 'react-native-paper';
    
    const MyScreen = () => (
      <>
        <Appbar.Header>
          <Appbar.Content title="My Awesome App" />
        </Appbar.Header>
        <Button mode="contained" onPress={() => console.log('Pressed')}>
          Click me
        </Button>
      </>
    );
    
    export default MyScreen;
    

Competitor Comparisons

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • Larger ecosystem and community support
  • More comprehensive component library
  • Better documentation and examples

Cons of Material-UI

  • Steeper learning curve due to more complex API
  • Larger bundle size, which may impact performance
  • Primarily designed for web applications, not mobile-first

Code Comparison

Material-UI:

import { Button, TextField } from '@mui/material';

<Button variant="contained" color="primary">
  Click me
</Button>
<TextField label="Enter text" variant="outlined" />

React Native Paper:

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

<Button mode="contained" onPress={() => console.log('Pressed')}>
  Click me
</Button>
<TextInput label="Enter text" mode="outlined" />

Summary

Material-UI is a popular choice for web applications with a large component library and extensive documentation. It offers more customization options but may have a steeper learning curve. React Native Paper is specifically designed for React Native applications, providing a more streamlined experience for mobile development with a smaller bundle size and simpler API. The choice between the two depends on the target platform (web vs. mobile) and the specific needs of the project.

Cross-Platform React Native UI Toolkit

Pros of React Native Elements

  • More comprehensive component library with a wider range of pre-built UI elements
  • Highly customizable components with extensive theming options
  • Strong community support and frequent updates

Cons of React Native Elements

  • Larger bundle size due to the extensive component library
  • Some components may require additional configuration or styling to match specific design requirements
  • Less focus on Material Design principles compared to React Native Paper

Code Comparison

React Native Elements:

import { Button, Icon } from 'react-native-elements';

<Button
  icon={<Icon name="arrow-right" size={15} color="white" />}
  title="Button with icon"
/>

React Native Paper:

import { Button, Icon } from 'react-native-paper';

<Button
  icon="arrow-right"
  mode="contained"
  onPress={() => console.log('Pressed')}
>
  Button with icon
</Button>

Both libraries offer similar functionality for creating buttons with icons, but React Native Paper follows Material Design more closely and has a more concise API for icon integration. React Native Elements provides more flexibility in icon customization but requires slightly more verbose code.

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.

Pros of NativeBase

  • More extensive component library with over 40 customizable components
  • Better support for accessibility features out of the box
  • Easier theming system with a more flexible and intuitive API

Cons of NativeBase

  • Larger bundle size, which may impact app performance
  • Steeper learning curve due to more complex API and customization options
  • Less frequent updates and maintenance compared to React Native Paper

Code Comparison

NativeBase:

import { Box, Text, Button } from 'native-base';

const MyComponent = () => (
  <Box>
    <Text>Hello World</Text>
    <Button>Click me</Button>
  </Box>
);

React Native Paper:

import { Surface, Text, Button } from 'react-native-paper';

const MyComponent = () => (
  <Surface>
    <Text>Hello World</Text>
    <Button mode="contained">Click me</Button>
  </Surface>
);

Both libraries offer similar basic components, but NativeBase provides a more extensive set of pre-built components and styling options. React Native Paper, on the other hand, focuses on Material Design and offers a more streamlined API. The choice between the two depends on project requirements, design preferences, and performance considerations.

UI Components Library for React Native

Pros of react-native-ui-lib

  • More extensive component library with a wider range of UI elements
  • Highly customizable components with built-in theming support
  • Better performance optimization for large lists and complex layouts

Cons of react-native-ui-lib

  • Steeper learning curve due to its extensive API and customization options
  • Less frequent updates and potentially slower bug fixes compared to react-native-paper
  • Larger bundle size, which may impact app performance on low-end devices

Code Comparison

react-native-ui-lib:

import { View, Text, Button } from 'react-native-ui-lib';

const MyComponent = () => (
  <View>
    <Text text60>Hello World</Text>
    <Button label="Click me" onPress={() => {}} />
  </View>
);

react-native-paper:

import { View } from 'react-native';
import { Text, Button } from 'react-native-paper';

const MyComponent = () => (
  <View>
    <Text>Hello World</Text>
    <Button onPress={() => {}}>Click me</Button>
  </View>
);

Both libraries offer similar basic components, but react-native-ui-lib provides more built-in styling options and a wider range of pre-designed UI elements. react-native-paper, on the other hand, focuses on simplicity and follows Material Design guidelines more closely.

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode

Pros of React Native UI Kitten

  • More extensive component library with a wider range of UI elements
  • Built-in theming system for easy customization and dark mode support
  • Strong TypeScript support and documentation

Cons of React Native UI Kitten

  • Less frequent updates and potentially slower bug fixes
  • Steeper learning curve due to its more complex theming system
  • Smaller community and fewer third-party extensions

Code Comparison

React Native UI Kitten:

import { Button, Text } from '@ui-kitten/components';

<Button>
  <Text>Click me!</Text>
</Button>

React Native Paper:

import { Button } from 'react-native-paper';

<Button mode="contained" onPress={() => console.log('Pressed')}>
  Click me!
</Button>

Both libraries offer similar basic components, but React Native UI Kitten often requires more setup for theming and customization. React Native Paper provides a more straightforward API for common use cases, while React Native UI Kitten offers more flexibility for complex designs.

React Native Paper generally has a larger community and more frequent updates, making it a safer choice for long-term project maintenance. However, React Native UI Kitten's extensive component library and powerful theming system can be advantageous for projects requiring highly customized UI designs.

4,895

Customizable set of components for React Native applications

Pros of Shoutem UI

  • More comprehensive UI toolkit with a wider range of pre-built components
  • Includes theming system and customizable styles out of the box
  • Offers a visual theme editor for easier customization

Cons of Shoutem UI

  • Less frequent updates and maintenance compared to React Native Paper
  • Steeper learning curve due to its more complex architecture
  • Smaller community and fewer third-party extensions

Code Comparison

React Native Paper:

import { Button } from 'react-native-paper';

<Button mode="contained" onPress={() => console.log('Pressed')}>
  Press me
</Button>

Shoutem UI:

import { Button } from '@shoutem/ui';

<Button styleName="secondary" onPress={() => console.log('Pressed')}>
  <Text>Press me</Text>
</Button>

Both libraries offer similar component APIs, but Shoutem UI uses a custom styleName prop for styling, while React Native Paper uses more standard React Native props. Shoutem UI also requires wrapping text content in a separate Text component.

React Native Paper generally provides a more streamlined and familiar API for React Native developers, while Shoutem UI offers a more comprehensive set of pre-built components and styling options at the cost of a steeper learning curve.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

react-native-paper

Material design for React Native.
reactnativepaper.com


Greenkeeper badge

Build Status Version MIT License All Contributors PRs Welcome Chat Sponsored by Callstack

React Native Paper is the cross-platform UI kit library containing a collection of customizable and production-ready components, which by default are following and respecting the Google’s Material Design guidelines.

Getting Started

Refer to the getting started guide for instructions.

Documentation

Check the components and their usage in our documentation.

Features

Try it out

🧑‍💻 Run the example app with Expo to see it in action. The source code for the examples are under the /example folder.

📲 You can also try out components in our demo apps available in the both stores Android and iOS.

Contributing

Read the contribution guidelines before contributing.

Figma and Sketch component kits

Use official component kits provided by Material Design.

Made with ❤️ at Callstack

react-native-paper is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. Callstack is a group of React and React Native geeks, contact us at hello@callstack.com if you need any help with these or just want to say hi!

Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥

Contributors

Thanks goes to these wonderful people (emoji key):

Satyajit Sahoo
Satyajit Sahoo

🤔 💻 📖
Ferran Negre
Ferran Negre

🤔 💻
Dawid
Dawid

🤔 💻 📖
Kacper Wiszczuk
Kacper Wiszczuk

🤔 💻
Luke Walczak
Luke Walczak

💻 📖
Ahmed Elhanafy
Ahmed Elhanafy

🤔 💻
K. P. Sroka
K. P. Sroka

💻 📖
Iyad Thayyil
Iyad Thayyil

💻 📖
Julian Hundeloh
Julian Hundeloh

💻 📖
Grzegorz Gawrysiak
Grzegorz Gawrysiak

💻 📖
Luís
Luís

💻
Rajendran Nadar
Rajendran Nadar

💻
Brent Vatne
Brent Vatne

💻
Jakub Beneš
Jakub Beneš

💻
Paweł Szymański
Paweł Szymański

💻 📖
Kuba
Kuba

💻 🤔
jbinda
jbinda

💻 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

NPM DownloadsLast 30 Days