Installation
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.
Install lucide-react icons
For the components that use icons, we use Lucide React icons.
npm install lucide-reactpnpm add lucide-reactbun add lucide-reactAdd a Utility Helper
To make it easier to conditionally apply Tailwind CSS classes, add this cn helper function to your project.
import { clsx, type ClassValue } from 'clsx'
import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}You might need to install the clsx and tailwind-merge packages.
npm install clsx tailwind-mergepnpm add clsx tailwind-mergebun add clsx tailwind-mergeAdd 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:
pnpm shadcn@latest add https://unlogg.com/r/star-rating-basic-ex-01.jsonnpx shadcn@latest add https://unlogg.com/r/star-rating-basic-ex-01.jsonbun shadcn@latest add https://unlogg.com/r/star-rating-basic-ex-01.jsonAnd then import the component in your project like:
"use client";
import StarRatingBasic from "@/components/unlogg-ui/test";
import { useState } from "react";
export default function Rating() {
const [rating, setRating] = useState(3);
return (
<div className="flex flex-row items-center gap-4">
<StarRatingBasic value={rating} onChange={setRating} maxStars={5} />
<p>({rating})</p>
{/* Rest of your code... */}
</div>
);
}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.