|
2 | 2 | title: Getting Started |
3 | 3 | --- |
4 | 4 |
|
| 5 | +import TabItem from '@theme/TabItem'; |
| 6 | +import Tabs from '@theme/Tabs'; |
| 7 | + |
5 | 8 | # Getting Started |
6 | 9 |
|
7 | 10 | ## Installation |
8 | 11 |
|
9 | | -- Open a Terminal in your project's folder and run: |
| 12 | +Open a Terminal in your project's folder and install the library: |
| 13 | + |
| 14 | +<Tabs groupId="expo-vs-cli"> |
| 15 | + <TabItem value="expo" label="Expo" default> |
| 16 | + |
| 17 | +```bash |
| 18 | +npx expo install react-native-paper |
| 19 | +``` |
| 20 | + |
| 21 | + </TabItem> |
| 22 | + <TabItem value="community-cli" label="Community CLI"> |
10 | 23 |
|
11 | 24 | ```bash npm2yarn |
12 | 25 | npm install react-native-paper |
13 | 26 | ``` |
14 | 27 |
|
15 | | -- From `v5` there is a need to install [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe area. |
| 28 | + </TabItem> |
| 29 | +</Tabs> |
16 | 30 |
|
17 | | -```bash npm2yarn |
18 | | -npm install react-native-safe-area-context |
| 31 | +React Native Paper uses [react-native-safe-area-context](https://github.com/th3rdwave/react-native-safe-area-context) for handling safe area, [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/) and [react-native-worklets](https://docs.swmansion.com/react-native-worklets/) for animations. |
| 32 | + |
| 33 | +<Tabs groupId="expo-vs-cli"> |
| 34 | + <TabItem value="expo" label="Expo" default> |
| 35 | + |
| 36 | +```bash |
| 37 | +npx expo install react-native-safe-area-context react-native-reanimated react-native-worklets |
19 | 38 | ``` |
20 | 39 |
|
21 | | -- You also need to install [react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/) and [react-native-worklets](https://docs.swmansion.com/react-native-worklets/) for animations. |
| 40 | + </TabItem> |
| 41 | + <TabItem value="community-cli" label="Community CLI"> |
22 | 42 |
|
23 | 43 | ```bash npm2yarn |
24 | | -npm install react-native-reanimated react-native-worklets |
| 44 | +npm install react-native-safe-area-context react-native-reanimated react-native-worklets |
25 | 45 | ``` |
26 | 46 |
|
27 | | -- Follow the [React Native Reanimated installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/) for your toolchain (Expo vs React Native Community CLI). **Community CLI** setups must add `'react-native-worklets/plugin'` **last** in your `babel.config.js` `plugins` array. **Expo** setups follow that guide’s Expo steps (install packages and rebuild native code); starter templates [since Expo SDK 50](https://expo.dev/changelog/2024/01-18-sdk-50) usually include the Worklets Babel plugin already—add it only if your `babel.config.js` does not. Paper declares **minimum** supported versions for `react-native-reanimated` and `react-native-worklets` under `peerDependencies` in [`package.json`](https://github.com/callstack/react-native-paper/blob/main/package.json) (`>=` ranges, not pinned versions). When troubleshooting animation or native build problems, confirm your installed packages meet those minimums. |
| 47 | + </TabItem> |
| 48 | +</Tabs> |
28 | 49 |
|
29 | | -Additionaly for `iOS` platform there is a requirement to link the native parts of the library: |
| 50 | +Follow the [React Native Reanimated installation guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/). |
30 | 51 |
|
31 | | -```bash |
32 | | -npx pod-install |
33 | | -``` |
| 52 | +Minimum requirements: |
| 53 | + |
| 54 | +- `react-native-reanimated` **≥ 4.3.0** |
| 55 | +- `react-native-worklets` **≥ 0.8.1** |
| 56 | +- `react-native-safe-area-context` — version compatible with your React Native toolchain. |
34 | 57 |
|
35 | | -- If you're on a vanilla React Native project, you also need to install and link [@react-native-vector-icons/material-design-icons](https://github.com/oblador/react-native-vector-icons). |
| 58 | +If you're on a vanilla React Native project, you also need to install and link [@react-native-vector-icons/material-design-icons](https://github.com/oblador/react-native-vector-icons). |
36 | 59 |
|
37 | 60 | Specifically `MaterialDesignIcons` icon pack needs to be included in the project, because some components use those internally (e.g. `AppBar.BackAction` on Android). |
38 | 61 |
|
|
0 commit comments