Installation
Get started with Craft UI by installing the necessary packages and configuring your project.Prerequisites
Before installing Craft UI, make sure you have the following:- Node.js 18.0 or later
- React 19.0 or later
- React DOM 19.0 or later
Understanding the monorepo structure
Craft UI is organized as a monorepo with workspace packages. The project contains:@craftdotui/baseui- Base UI components@craftdotui/craftui- Craft UI animated components@craftdotui/loaders- Loading spinners and animations@craftdotui/hooks- Utility hooks@craftdotui/lib- Shared utilities
Craft UI uses a registry-based installation system. Instead of installing packages via npm, you copy components directly into your project. This gives you full control over the code and makes customization easier.
Installation methods
- CLI (Recommended)
- Manual
The easiest way to add Craft UI components to your project is using the CLI:This will:
- Copy the component code into your project
- Install required dependencies
- Set up necessary configuration
Required dependencies
Craft UI components require the following peer dependencies:Core dependencies
Styling dependencies
Install Tailwind CSS v4 and related packages:Component dependencies
Base UI components require:Configure Tailwind CSS
1
Create your CSS file
Create a
globals.css file (or similar) with the following content:globals.css
2
Import the CSS file
Import your CSS file in your root layout or
_app.tsx:app/layout.tsx
3
Configure PostCSS
Create a
postcss.config.js file:postcss.config.js
Set up utilities
Create a utility file for thecn helper function:
lib/utils.ts
TypeScript configuration
Make sure yourtsconfig.json includes path aliases:
tsconfig.json
Next steps
You’re all set! Now you can:Quickstart guide
Build your first component
Browse components
Explore all available components