UNPKG

@sglara/cn

Version:

A utility function that combines the power of `clsx` and `tailwind-merge` for seamless management of Tailwind CSS class names.

11 lines (10 loc) 327 B
import { clsx } from "clsx"; import { twMerge } from "tailwind-merge"; /** * Combines clsx and tailwind-merge for optimal class merging. * @param inputs - Class names or conditional class values. * @returns A single string with merged class names. */ export const cn = (...inputs) => { return twMerge(clsx(inputs)); };