Quick Start
Get started with HeroUI Native in minutes
Getting Started
1. Install HeroUI Native
npm install heroui-nativepnpm add heroui-nativeyarn add heroui-nativebun add heroui-native2. Install Mandatory Peer Dependencies
npm install react-native-screens@~4.16.0 react-native-reanimated@~4.1.1 react-native-gesture-handler@^2.28.0 react-native-worklets@0.5.1 react-native-safe-area-context@~5.6.0 react-native-svg@15.12.1 tailwind-variants@^3.2.2 tailwind-merge@^3.4.0 @gorhom/bottom-sheet@^5pnpm add react-native-screens@~4.16.0 react-native-reanimated@~4.1.1 react-native-gesture-handler@^2.28.0 react-native-worklets@0.5.1 react-native-safe-area-context@~5.6.0 react-native-svg@15.12.1 tailwind-variants@^3.2.2 tailwind-merge@^3.4.0 @gorhom/bottom-sheet@^5yarn add react-native-screens@~4.16.0 react-native-reanimated@~4.1.1 react-native-gesture-handler@^2.28.0 react-native-worklets@0.5.1 react-native-safe-area-context@~5.6.0 react-native-svg@15.12.1 tailwind-variants@^3.2.2 tailwind-merge@^3.4.0 @gorhom/bottom-sheet@^5bun add react-native-screens@~4.16.0 react-native-reanimated@~4.1.1 react-native-gesture-handler@^2.28.0 react-native-worklets@0.5.1 react-native-safe-area-context@~5.6.0 react-native-svg@15.12.1 tailwind-variants@^3.2.2 tailwind-merge@^3.4.0 @gorhom/bottom-sheet@^5It's recommended to use the exact versions specified above to avoid compatibility issues. Version mismatches may cause unexpected bugs.
3. Set Up Uniwind
Follow the Uniwind installation guide to set up Tailwind CSS for React Native.
If you're migrating from NativeWind, see the migration guide.
4. Configure global.css
Inside your global.css file add the following imports:
@import 'tailwindcss';
@import 'uniwind';
@import 'heroui-native/styles';
/* Path to the heroui-native lib inside node_modules from the root of your project */
@source './node_modules/heroui-native/lib';5. Wrap Your App with Provider
Wrap your application with HeroUINativeProvider. You must wrap it with GestureHandlerRootView:
import { HeroUINativeProvider } from 'heroui-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
export default function App() {
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<HeroUINativeProvider>{/* Your app content */}</HeroUINativeProvider>
</GestureHandlerRootView>
);
}Note: For advanced configuration options including text props, animation settings, and toast configuration, see the Provider documentation.
6. Use Your First Component
import { Button } from 'heroui-native';
import { View } from 'react-native';
export default function MyComponent() {
return (
<View className="flex-1 justify-center items-center bg-background">
<Button onPress={() => console.log('Pressed!')}>Get Started</Button>
</View>
);
}What's Next?
Running on Web (Expo)
HeroUI Native is currently not recommended for web use. We are focusing on mobile platforms (iOS and Android) at this time.