Installation

This library requires Uniwind to be set up in your project. Follow the Uniwind installation guide to configure it before proceeding.

Install the library.

npm install @nayan-ui/react-native

Install peer dependencies (most Expo projects already include these).

npm install react-native-reanimated react-native-gesture-handler react-native-safe-area-context react-native-screens react-native-svg react-native-worklets

Configuration

Create a global.css file in your project with the following imports:

@import 'tailwindcss';
@import 'uniwind';
@import 'heroui-native/styles';

Import this CSS file in your app entry point.

Usage

Wrap your app with the NTheme provider:

import { View } from 'react-native';
import { NButton, NTheme, NThemeToggle, useNTheme } from '@nayan-ui/react-native';
import './global.css';
export default function App() {
const { isDarkMode } = useNTheme();
return (
<NTheme>
<View className="flex-1 justify-center items-center bg-background">
<NThemeToggle />
<NButton onPress={() => console.log('Pressed!')}>
{isDarkMode ? 'Dark Mode' : 'Light Mode'}
</NButton>
</View>
</NTheme>
);
}