tailwind-merge

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