Skip to content
VenusUI
Get started
Docs

Add utilities

Set up shadcn: components.json, theme variables and the cn helper every component uses.

Recommended: shadcn init

  1. Step 1: Run shadcn init in your project

    npx shadcn@latest init

    It asks a few questions and then:

    • creates components.json, which tells the CLI where to put files (your aliases);
    • adds theme variables such as --background, --card and --muted-foreground to your global CSS. VenusUI components use these, so they match your theme;
    • adds a cn helper at @/lib/utils that merges class names.
  2. Step 2: Pick Radix or Base UI

    Both work. VenusUI is tested against fresh apps with each. Blocks that need a shadcn primitive, such as button, get the version that matches your choice.

Manual setup

If you can’t run init, add the cn helper yourself. You also need the shadcn theme variables in your CSS, or colors such as bg-card won’t exist.

npm install clsx tailwind-merge

lib/utils.ts

import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"

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