Material Design for React Native

5.15.1 · active · verified Sun Apr 19

React Native Paper is an actively maintained cross-platform UI kit library for React Native, currently at version 5.15.1. It provides a comprehensive collection of customizable and production-ready components that strictly adhere to Google's Material Design guidelines, including full support for Material Design 3 (MD3). The library offers robust theming capabilities, allowing developers to easily adapt the visual style of their applications. It maintains a regular release cadence with frequent bug fixes and minor versions introducing new features or deprecations. Key differentiators include its deep integration with Material Design principles, its platform adaptation for both iOS and Android, and its comprehensive theming system, making it a strong choice for building consistent and aesthetically pleasing React Native applications.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic React Native Paper application with theming using PaperProvider, Appbar, Text, and Button components.

import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { Button, MD3LightTheme, PaperProvider, Text, Appbar } from 'react-native-paper';

const theme = {
  ...MD3LightTheme,
  colors: {
    ...MD3LightTheme.colors,
    primary: '#673ab7',
    accent: '#ff4081',
  },
};

export default function App() {
  const [count, setCount] = React.useState(0);

  return (
    <PaperProvider theme={theme}>
      <Appbar.Header>
        <Appbar.Content title="My Paper App" />
      </Appbar.Header>
      <View style={styles.container}>
        <Text variant="headlineMedium">Count: {count}</Text>
        <Button 
          mode="contained"
          onPress={() => setCount(c => c + 1)}
          style={styles.button}
        >
          Increment
        </Button>
        <Button 
          mode="outlined"
          onPress={() => setCount(0)}
          style={styles.button}
        >
          Reset
        </Button>
      </View>
    </PaperProvider>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    padding: 16,
    backgroundColor: theme.colors.background,
  },
  button: {
    marginVertical: 8,
    width: 200,
  },
});

view raw JSON →