Getting Started
Get started with NovaUI - a React Native UI component library built on NativeWind. Learn how to set up your project and add your first components.
NovaUI is a React Native UI component library with 50+ components built on NativeWind (Tailwind CSS for React Native). Inspired by shadcn/ui, adapted for mobile. Components are copied directly into your project — you own the code and can customize anything.
Prerequisites
Before getting started with NovaUI, ensure you have the following requirements:
| Package | Minimum Version |
|---|---|
| React | >= 18 |
| React Native | >= 0.72 |
| NativeWind | >= 4 |
| Tailwind CSS | >= 3 |
Step 1: Set Up NativeWind
Important: NovaUI requires NativeWind to be properly configured in your project. If you haven't set up NativeWind yet, please follow the NativeWind installation guide first.
Quick NativeWind Setup Checklist
-
Install NativeWind:
npm install nativewind # or yarn add nativewind -
Install Tailwind CSS:
npm install -D tailwindcss # or yarn add -D tailwindcss -
Initialize Tailwind Config:
npx tailwindcss init -
Configure NativeWind in your
tailwind.config.js:/** @type {import('tailwindcss').Config} */ module.exports = { content: [ "./App.{js,jsx,ts,tsx}", "./src/**/*.{js,jsx,ts,tsx}", ], presets: [require("nativewind/preset")], theme: { extend: {}, }, plugins: [], } -
Set up Babel (if not already configured):
// babel.config.js module.exports = { plugins: [ "nativewind/babel", ], } -
Import CSS in your root file (e.g.,
App.tsx):import "./global.css"
For complete NativeWind setup instructions, including platform-specific configurations, visit the NativeWind documentation.
Step 2: Initialize NovaUI
Once NativeWind is set up, initialize NovaUI in your project:
npx novaui-cli initThis interactive command will guide you through the setup process and ask you to configure file paths:
? Path for global.css? (src/global.css)
? Path for UI components? (src/components/ui)
? Path for lib (utils)? (src/lib)What Gets Created
The init command creates the following files and configurations:
components.json— Stores your configured paths for future component additionstailwind.config.js— NovaUI theme configuration with colors, border radius, and NativeWind presetglobal.css— Light and dark theme CSS variableslib/utils.ts— Thecn()utility function for merging Tailwind classes
Dependencies Installed
The CLI automatically installs the required dependencies:
nativewind— Tailwind CSS for React Nativetailwindcss— Tailwind CSS frameworkclsx— Utility for constructing className stringstailwind-merge— Utility to merge Tailwind CSS classes without style conflictsclass-variance-authority— Utility for creating type-safe component variants
Step 3: Import Global Styles
Make sure to import the global.css file in your root entry file (typically App.tsx or index.js):
import "./src/global.css"
// or wherever your global.css is located
export default function App() {
return (
// Your app content
)
}This ensures that NovaUI's theme variables and styles are available throughout your application.
Step 4: Add Your First Component
Add components to your project using the add command:
npx novaui-cli add button
npx novaui-cli add card
npx novaui-cli add avatarComponents are copied directly into your configured directory (default: src/components/ui/). Each component's dependencies are automatically installed.
Component Naming
Use the component filename without the extension:
- ✅
button(notbutton.tsx) - ✅
alert-dialog(notalert-dialog.tsx) - ✅
dropdown-menu(notdropdown-menu.tsx)
Step 5: Use Components
Import and use components in your React Native app:
import { Button } from "./src/components/ui/button"
import { Card, CardHeader, CardTitle, CardContent } from "./src/components/ui/card"
export default function App() {
return (
<Card>
<CardHeader>
<CardTitle>Welcome to NovaUI</CardTitle>
</CardHeader>
<CardContent>
<Button onPress={() => console.log("Pressed!")}>
Get Started
</Button>
</CardContent>
</Card>
)
}Available Components
NovaUI includes 50+ components ready to use:
Layout & Structure: Accordion, Alert, Alert Dialog, Aspect Ratio, Card, Collapsible, Dialog, Drawer, Separator, Sheet
Navigation: Breadcrumb, Command, Context Menu, Dropdown Menu, Menubar, Navigation Menu, Tabs
Forms & Input: Button, Button Group, Checkbox, Combobox, Field, Input, Input Group, Input OTP, Label, Radio Group, Select, Switch, Textarea, Toggle, Toggle Group
Data Display: Avatar, Badge, Calendar, Carousel, Chart, Empty, Pagination, Progress, Skeleton, Spinner, Table, Typography
Overlays: Hover Card, Popover, Resizable, Scroll Area
Text: Text
Add any component with:
npx novaui-cli add <component-name>Configuration
Customizing Paths
The components.json file stores your project configuration:
{
"globalCss": "src/global.css",
"componentsUi": "src/components/ui",
"lib": "src/lib"
}To change these paths, either:
- Edit
components.jsondirectly, or - Run
npx novaui-cli initagain to reconfigure
Customizing Themes
NovaUI components use CSS variables for theming. Customize colors, spacing, and other design tokens in your global.css file:
@theme {
--color-primary: 222.2 47.4% 11.2%;
--color-primary-foreground: 210 40% 98%;
/* ... more theme variables */
}The tailwind.config.js generated by NovaUI includes a comprehensive theme configuration that you can customize to match your brand.
CLI Commands Reference
| Command | Description |
|---|---|
npx novaui-cli init | Interactive setup — creates config, Tailwind config, global CSS, and utils |
npx novaui-cli add <name> | Add a component to your project |
npx novaui-cli --version | Show CLI version |
npx novaui-cli --help | Show help and available commands |
Next Steps
Now that you're set up, here are some recommended next steps:
- Explore Components: Browse the component documentation to see all available components
- Customize Themes: Adjust colors and styles in
global.cssto match your brand - Read Best Practices: Learn about component composition and customization patterns
- Join the Community: Check out the GitHub repository for updates and contributions
Troubleshooting
Components Not Styling Correctly
- Ensure
global.cssis imported in your root file - Verify NativeWind is properly configured in
babel.config.js - Check that
tailwind.config.jsincludes the NativeWind preset - Make sure your content paths in
tailwind.config.jsinclude your component directories
TypeScript Errors
- Ensure you have
@types/reactand@types/react-nativeinstalled - Check that your
tsconfig.jsonincludes the component paths
Build Issues
- Clear your build cache:
npx react-native start --reset-cache - Reinstall dependencies:
rm -rf node_modules && npm install - Verify all peer dependencies are installed
Need Help?
- 📖 NativeWind Documentation — Learn more about NativeWind
- 🐛 GitHub Issues — Report bugs or request features
- 💬 GitHub Discussions — Ask questions and share ideas