MCPcopy Create free account
hub / github.com/dcastil/tailwind-merge

github.com/dcastil/tailwind-merge

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.6.1 ↗ · + Follow · compare 3 versions
90 symbols 253 edges 54 files ⚖ MIT 6 documented · 7% updated 5d agotailwind-merge@3.7.0 · 2026-09-12★ 5,69021 open issues

Browse by type

Functions 80 Types & classes 10
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<a href="https://github.com/dcastil/tailwind-merge">
    <img src="https://github.com/dcastil/tailwind-merge/raw/v2.6.1/assets/logo.svg" alt="tailwind-merge" height="150px" />
</a>

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

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 76
Interface 10
Method 4

Languages

TypeScript100%

Modules by API surface

src/lib/validators.ts18 symbols
src/lib/default-config.ts14 symbols
src/lib/class-group-utils.ts12 symbols
src/lib/types.ts9 symbols
src/lib/lru-cache.ts7 symbols
scripts/update-readme.mjs5 symbols
src/lib/merge-configs.ts4 symbols
src/lib/parse-class-name.ts3 symbols
src/lib/create-tailwind-merge.ts3 symbols
tests/public-api.test.ts2 symbols
src/lib/tw-join.ts2 symbols
src/lib/from-theme.ts2 symbols

Dependencies from manifests, versioned

@babel/core7.26.0 · 1×
@babel/preset-env7.26.0 · 1×
@codspeed/vitest-plugin4.0.0 · 1×
@rollup/plugin-babel6.0.4 · 1×
@rollup/plugin-node-resolve16.0.0 · 1×
@vitest/coverage-v82.1.8 · 1×
@vitest/eslint-plugin1.1.22 · 1×
babel-plugin-annotate-pure-calls0.4.0 · 1×
babel-plugin-polyfill-regenerator0.6.3 · 1×
eslint9.17.0 · 1×

For agents

$ claude mcp add tailwind-merge \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page