Getting started
We put a lot of effort into making Unistyles as easy to use as possible. You no longer need the useStyle
hook or wrap your app in provider. Unistyles integrates seamlessly with your existing code, so you can start using it immediately.
Prerequisites
Unistyles 3.0 is tightly integrated with Fabric
and the latest version of React Native. Therefore, you must use the New Architecture and at least React Native 0.76.0. Additionally, Unistyles relies on react-native-nitro-modules
and react-native-edge-to-edge
.
Table of requirements:
Required | Note | |
---|---|---|
React Native | 0.76+ | |
New Architecture | enabled | no option to opt-out |
Expo SDK | 52+ | (if you use Expo) |
Xcode | 16+ | Required by Nitro Modules |
Since Unistyles relies on Fabric
, it cannot run on the Old Architecture
or older versions of React Native. If you can’t meet these requirements, you can use Unistyles 2.0+, which is compatible with those versions.
Installation
Add babel plugin:
Finish installation based on your platform:
Unistyles offers first-class support for React Native Web. To run the project, we recommend following the guidelines provided by Expo.
🚧 Work in progress, we will share more details soon.
🚧 Work in progress, we will share more details soon.
As easy as React Native StyleSheet
Getting started with Unistyles couldn’t be easier. Simply replace React Native’s StyleSheet
with the StyleSheet
exported from Unistyles. From that moment, you’ll be using a StyleSheet
with superpowers 🦸🏼♂️.
By replacing StyleSheet
, you immediately gain several benefits that aren’t available in React Native’s StyleSheet
:
- Variants
- Compound variants
- Dynamic functions
- Media queries
- Horizontal and vertical breakpoints for Native
- Custom web styles
- Web only features
When you’re ready to customize your styles and unlock additional features you can configure Unistyles.