Installation guide
Learn how to install and configure the required dependencies to integrate the components into your React Native project. Follow this step-by-step guide to get started.
Prerequisites
The components have been tested with the following versions of key dependencies:
- React 18.3+
- React Native 0.76+
- Node.js 22+
- TypeScript 5.3+
While the components might work with different versions, we've thoroughly tested and optimized them for these specific versions. For the best experience and to avoid potential compatibility issues:
- Use the versions listed above when starting a new project
- If using different versions, thoroughly test your application
Install dependencies
The components are built on several essential dependencies that provide core functionality. To get started, you'll need to install these foundational libraries:
Install all required dependencies with this command:
To learn more about those libraries, head to the Reanimated, Gesture Handler, SVG and Unistyles documentation.
Unistyle v3 & Reanimated v4 are currently in beta and will soon be released. I will consider migrating the components at some point.
Unistyles configuration
All components use Unistyles for styling.
First, locate and copy the folder craftrn-ui/themes to the root of your project.
Then, import the unistyles.ts
file in your app's entry point:
- For React Native CLI projects, import it in
App.tsx
orindex.ts
- For Expo projects, import it in
App.tsx
orapp/_layout.tsx
(if using Expo Router)
The import should look like this:
Add components
With the dependencies and configuration in place, you can now add the components to your project. Follow these steps:
- Navigate to craftrn-ui/components in the repository
- Choose the components you want to use in your project
- Copy the selected component folders to your project's
craftrn-ui/components
directory - Import and use the components in your application code
If you use Expo, your project should look like this:
Quick start
Running the demo app locally will allow you to browse through the components and interact with them.
Avatar
An avatar component displaying a user's profile picture or initials. It supports different sizes and can be customized with a color. It also supports showing a green dot to indicate the user is online.