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

github.com/dcastil/tailwind-merge

Chat with this repo
repository ↗ · DeepWiki ↗ · release tailwind-merge@3.7.0 ↗ · + Follow · compare 2 versions
449 symbols 1,486 edges 157 files ⚖ MIT 107 documented · 24% updated 2d agotailwind-merge@3.7.0 · 2026-09-12★ 5,68921 open issues

Browse by type

Functions 395 Types & classes 54
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/tailwind-merge@3.7.0/packages/tailwind-merge/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

Packages in this repository

This repository is a monorepo. The docs above belong to the tailwind-merge package — what most visitors are here for — and everything package-specific (source, docs, changelog) lives in the package directories.

Package Description
tailwind-merge (npm) The library itself — see the docs above.
@tailwind-merge/vite Automatic theme configuration and source-based pruning for Vite apps. Unreleased.
@tailwind-merge/configurator JavaScript API and CLI for generating a theme-specific merge module. Unreleased; API remains unstable.

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 385
Interface 54
Method 10

Languages

TypeScript100%

Modules by API surface

packages/tailwind-merge/src/lib/validators.ts39 symbols
packages/tailwind-merge/src/lib/default-config.ts33 symbols
packages/vite/src/index.ts23 symbols
packages/configurator/src/emit.ts23 symbols
packages/configurator/src/plan.ts20 symbols
packages/configurator/src/design-system.ts20 symbols
packages/configurator/tests/fixture-utils.ts19 symbols
packages/tailwind-merge/src/lib/class-group-utils.ts18 symbols
packages/configurator/src/custom-utilities.ts18 symbols
packages/vite/tests/helpers.ts13 symbols
packages/vite/src/generation.ts13 symbols
packages/vite/src/generation-session.ts11 symbols

Dependencies from manifests, versioned

@babel/core8.0.1 · 1×
@babel/preset-env8.0.2 · 1×
@codspeed/vitest-plugin5.7.1 · 1×
@rollup/plugin-babel7.1.0 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@tailwindcss/node4.3.3 · 1×
@tailwindcss/oxide4.3.3 · 1×
@tailwindcss/vite4.3.3 · 1×
@types/nodecatalog: · 1×
@vitest/coverage-v84.1.10 · 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