Installation
Integrate NachUI into your React project in less than two minutes. Install dependencies, setup Tailwind, and import component source code.
Prerequisites
Before you begin, make sure you have installed:
- React 18+ or Next.js 15+
- TypeScript
- Tailwind CSS v3+
- Node.js 18+
Step-by-step installation
Set up Tailwind CSS
If you don't have Tailwind CSS installed yet, follow the official guide:
Install required dependencies
NachUI requires the following libraries to work properly:
npm install install motion clsx tailwind-merge class-variance-authority lucide-reactThese libraries are used for:
- motion: Smooth animations and transitions (Framer Motion)
- clsx: Conditional CSS class construction
- tailwind-merge: Smart merging of Tailwind classes
- class-variance-authority: Component variant management
- lucide-react: Icons used in components
Configure the cn function
Create a utility file for the
cn function that will combine CSS classes:This function is used by all NachUI components to intelligently merge Tailwind classes.
Add CSS variables
Add the color variables to your global CSS file (typically
globals.css or app.css):Add variables to @theme
Recommended Project Structure
Here's the recommended folder structure for organizing NachUI components in your project:
src
app
components
ui
button.tsx
card.tsx
tabs.tsx
...
header.tsx
footer.tsx
lib
package.json
tailwind.config.ts
tsconfig.json
Key directories:
components/ui/- NachUI components (copied from docs)lib/- Utility functions likecn
How to use components
Once your project is configured, you can start copying components:
- Navigate to the component page you want to use
- Copy the component code
- Paste it into your project (typically in
components/ui/) - Adjust import paths if necessary
- Customize the component according to your needs
Next steps
- Explore the component gallery to see all available components
- Read about customization to learn how to adapt components to your design
- Check out examples to see real-world use cases
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.