How to install and use Shadix UI components in your project
Prerequisites
Before using Shadix UI components, ensure you have:
- Node.js 20 or higher
- A React project with TypeScript
- Tailwind CSS configured
- shadcn/ui base components installed
Installation
1. Install the shadcn CLI
If you don't have the shadcn CLI installed, add it to your project:
2. Initialize shadcn/ui
Initialize shadcn/ui in your project if you haven't already:
3. Configure the Shadix UI Registry
Add the Shadix UI registry to your components.json file:
Your complete components.json should look something like this:
4. Install Components
Option A: Using the Namespace (Recommended)
Install components using the @shadix-ui namespace:
Or install multiple components at once:
Option B: Direct Registry URL (Optional)
If you prefer not to configure the namespace, you can install components directly using the registry URL:
This method is useful for:
- Testing components without modifying your
components.json - One-time installations
- CI/CD environments where you don't want to persist registry configuration
Usage
Once installed, you can import and use the components in your React application:
Available Components
View all available components in the Components section.
Troubleshooting
Registry not configured
If you see an error about the registry not being configured, make sure you've added the @shadix-ui registry to your components.json file as shown in step 3.
Component not found
If a component fails to install, verify that:
- The component name is correct
- Your internet connection is active
- The registry URL is accessible
Dependencies issues
Shadix UI components may have dependencies on base shadcn/ui components. The CLI will automatically install these dependencies, but if you encounter issues:
- Make sure shadcn/ui is properly initialized
- Check that your
components.jsonis correctly configured - Try installing the base component manually first
- For more information, please refer to the shadcn/ui documentation
For more help, please open an issue on GitHub.