tailwind-class-merge
Version:
A utility function that combines `clsx` and `tailwind-merge` to ensure that a string of Tailwind CSS classnames are free of duplications and conflicts.
10 lines (9 loc) • 630 B
TypeScript
import { type ClassValue } from "clsx";
/**
* Combines classnames using `clsx` and then merges the result with `twMerge` to optimize Tailwind CSS class utilities.
* This function ensures that the resulting class string is free of duplicate or conflicting Tailwind utility classes.
*
* @param {ClassValue[]} inputs - An array of class values that can be strings, objects, or arrays that will be processed by `clsx`.
* @returns {string} A string that represents the merged and optimized class names for use in a className attribute in React components.
*/
export declare const classMerge: (...inputs: ClassValue[]) => string;