Installation

How to install unite-ui in your app.

This guide will help you install and set up unite-ui components in your Vue or Nuxt application.

Getting Started with unite-ui

Installation Steps

1. Set up tailwindcss

To begin, install tailwindcss using this guide.

2. Add depedencies

Install libraries for tailwindcss and utilities.

npm
pnpm
bun
yarn
npm install -D @inspira-ui/plugins clsx tailwind-merge class-variance-authority tailwindcss-animate

Install VueUse and other supporting libraries.

npm
pnpm
bun
yarn
npm install @vueuse/core motion-v

Follow this guide to setup motion-v on Vue and Nuxt

3. Update tailwind.config.js and tailwind.css

Add the following code to your tailwind.config.js and your css file:

tailwind.config.js
tailwind.css
import animate from "tailwindcss-animate";
import { setupInspiraUI } from "@inspira-ui/plugins";

export default {
  darkMode: "selector",
  safelist: ["dark"],
  prefix: "",
  content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"],
  theme: {
    extend: {
      colors: {
        border: "hsl(var(--border))",
        input: "hsl(var(--input))",
        ring: "hsl(var(--ring))",
        background: "hsl(var(--background))",
        foreground: "hsl(var(--foreground))",
        primary: {
          DEFAULT: "hsl(var(--primary))",
          foreground: "hsl(var(--primary-foreground))",
        },
        secondary: {
          DEFAULT: "hsl(var(--secondary))",
          foreground: "hsl(var(--secondary-foreground))",
        },
        destructive: {
          DEFAULT: "hsl(var(--destructive))",
          foreground: "hsl(var(--destructive-foreground))",
        },
        muted: {
          DEFAULT: "hsl(var(--muted))",
          foreground: "hsl(var(--muted-foreground))",
        },
        accent: {
          DEFAULT: "hsl(var(--accent))",
          foreground: "hsl(var(--accent-foreground))",
        },
        popover: {
          DEFAULT: "hsl(var(--popover))",
          foreground: "hsl(var(--popover-foreground))",
        },
        card: {
          DEFAULT: "hsl(var(--card))",
          foreground: "hsl(var(--card-foreground))",
        },
      },
      borderRadius: {
        xl: "calc(var(--radius) + 4px)",
        lg: "var(--radius)",
        md: "calc(var(--radius) - 2px)",
        sm: "calc(var(--radius) - 4px)",
      },
    },
  },

  plugins: [animate, setupInspiraUI],
};

4. Setup cn utility

Add following utility to lib/utils.ts

utils.ts
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

export type ObjectValues<T> = T[keyof T];

Start Using unite-ui 🚀

Now, you can start using unite-ui components in your project. Choose the components you need, copy the code, and integrate them into your application.

:: ::