cn() utility function (clsx + tailwind-merge)
Install
npx shadcn add https://ui.happenings.social/r/utils.json
Or with namespace
npx shadcn add @happenings/utils
Preview
cn() utility — clsx + tailwind-merge for conditional and merged class names.
Dependencies
src/lib/utils.ts
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function getCloseLabel(): string {
return "Close"
}