...

tailwind-merge

Merge Tailwind CSS classes without style conflicts
github-icon
GitHub
5.34kstar-icon
Created 4 years ago, last commit a month ago
34 contributors
1.34k commits
Stars added on GitHub, month by month
8
9
10
11
12
1
2
3
4
5
6
7
2024
2025
Stars added on GitHub, per day, on average
Yesterday
+1star-icon
Last week
+1.1
star-icon /day
Last month
+1.5
star-icon /day
Last 12 months
+2.5
star-icon /day
npmPackage on NPM
Monthly downloads on NPM
8
9
10
11
12
1
2
3
4
5
6
7
2024
2025
No dependencies
README

tailwind-merge

Utility function to efficiently merge Tailwind CSS classes in JS without style conflicts.

import { twMerge } from 'tailwind-merge'

twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
// → 'hover:bg-dark-red p-3 bg-[#B91C1C]'

Get started