Installation
A simple guide to set up commerce ui with the required dependencies and structure.
This project is built with Next.js, using TypeScript and Tailwind CSS for all components.
Install Tailwind CSS
The components are styled using Tailwind CSS v.4.
Follow the official installation guide to set it up in your project. If you are still using Tailwind CSS v.3, you can follow the Tailwindcss v.4 migration guide.
Add a Utility Helper
To make it easier to conditionally apply Tailwind CSS classes, add this cn
helper function to your project.
You might need to install the clsx
and tailwind-merge
packages.
Add your first component
Now that you have set up the required dependencies, you can start adding components to your project.
For example, to add the StarRating
component, you can just:
And then import the component in your project like:
Done! 🎉
You can now manually copy-paste the components or use the CLI to add components, blocks, and pages to your project.
Some components also rely on other third-party libraries like shadcn/ui and Motion. These dependencies are specified in the component documentation.
We recommend using the CLI
If you are using the CLI to add components, you don't need to worry about the dependencies. The CLI will take care of installing them for you. See the CLI documentation for more information.