tailwind-merge

Merge Tailwind CSS classes without style conflicts
GitHub
4.82k
Created 4 years ago, last commit 2 days ago
31 contributors
1.24k commits
Stars added on GitHub, month by month
2
3
4
5
6
7
8
9
10
11
12
1
2024
2025
Stars added on GitHub, per day, on average
Yesterday
+4
Last week
+3.0
/day
Last month
+2.8
/day
Last 12 months
+3.2
/day
npmPackage on NPM
Monthly downloads on NPM
2
3
4
5
6
7
8
9
10
11
12
1
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