Last active
July 13, 2025 19:41
-
-
Save jrobinsonc/3690e5b835a09d27801338bf786a4bae to your computer and use it in GitHub Desktop.
Merge Tailwind CSS classes efficiently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { clsx, type ClassValue } from 'clsx'; | |
import { twMerge } from 'tailwind-merge'; | |
/** | |
* Merge Tailwind CSS classes efficiently. | |
* | |
* @param inputs - Class values to merge. | |
* @returns Merged class names. | |
*/ | |
export function cn(...inputs: ClassValue[]): string { | |
return twMerge(clsx(inputs)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment