cntw
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

cntw (classnames + tailwind-merge)

A simple JavaScript utility for conditionally joining Tailwind CSS classes together.

Installation

pnpm add cntw

Usage

import { cn } from "cntw";

export default function ButtonExample() {
  const disabled = true;

  return (
    <button
      className={cn(
        "rounded-md bg-green-500 px-4 py-2 font-bold text-white",
        disabled && "bg-red-500"
      )}
    >
      Click me
    </button>
  );
}

Package Sidebar

Install

npm i cntw

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.7 kB

Total Files

5

Last publish

Collaborators

  • sshkeda