@riverfl0w/clsxm
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@riverfl0w/clsxm

This is @riverfl0w/clsxm, a small, efficient utility that combines the functionality of clsx and tailwind-merge. It is designed for projects using Tailwind CSS, providing a streamlined way to handle conditional class names and optimize them for production.

Features

  • Efficient Class Name Merging: Seamlessly merge class names using clsx and optimize them using tailwind-merge.
  • Tailwind CSS Compatibility: Perfect for projects using Tailwind CSS.
  • Simple API: Easy-to-use function that takes any number of class name arguments.

Installation

To install @riverfl0w/clsxm, you can use npm or yarn:

npm install @riverfl0w/clsxm
# or
yarn add @riverfl0w/clsxm

Usage

Import clsxm into your project and use it to concatenate and optimize class names:

import clsxm from '@riverfl0w/clsxm';

const buttonClass = clsxm(
  'p-4',
  'text-white',
  { 'bg-blue-500': !isError, 'bg-red-500': isError },
  { 'rounded-lg': isLarge },
);

API

clsxm(...classes)

  • `...classes: (ClassValue[])`` - An array of class values (string, array, object, or null/undefined).

Returns a string of optimized class names.`

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Authors

Licensing

The code in this project is licensed under MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @riverfl0w/clsxm

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

13.1 kB

Total Files

10

Last publish

Collaborators

  • mathieu-bour