@febin52/class-merge
v1.0.2
Published
Zero-dependency tailwind/CSS classname joiner & conditional merge helper.
Downloads
494
Maintainers
Readme
🎨 @febin52/class-merge
Zero-dependency Tailwind CSS and classname joiner & conditional class merge utility.
A ultra-fast, zero-dependency alternative to clsx and classnames for conditionally joining CSS class names together.
🚀 Features
- ⚡ Zero Dependencies: Lightweight and fast.
- 🧩 Flexible Syntax: Accepts strings, objects, arrays, undefined, null, and booleans.
- 🎨 Tailwind Compatible: Perfect for building UI component libraries with Tailwind CSS.
📦 Installation
npm install @febin52/class-merge💡 Usage
import { cn } from '@febin52/class-merge';
// String & Conditionals
cn('btn', true && 'btn-active', false && 'hidden');
// => 'btn btn-active'
// Objects & Arrays
cn('p-4', { 'bg-blue-500': true, 'text-white': false }, ['rounded-lg', null]);
// => 'p-4 bg-blue-500 rounded-lg'🔗 Links
- NPM Package: https://www.npmjs.com/package/@febin52/class-merge
- GitHub Repository: https://github.com/febin52/class-merge
- Issue Tracker: https://github.com/febin52/class-merge/issues
📄 License
MIT © Febin Francis
