Kanso UI LogoKanso UI
Components/utilities
Installation

Add utilities

Set up the standard class merging helper (cn) using clsx and tailwind-merge.

1

Install class merging dependencies

Add clsx for conditional class resolution and tailwind-merge to clean up conflicting utility overrides.

pnpm add clsx tailwind-merge
2

Create utils helper

Create a lib/utils.ts file and paste the helper function code below.

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

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

Command Palette

Search for a command to run...