tailwind-merge

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