mariosant-cn
v0.0.3
Published
Just add `@mariosant/cn` to your `package.json`.
Downloads
3
Readme
Easy class names handling!
Cn is a simple utility to help you manage class names in the modern app development ecosystem.
Installation
Just add @mariosant/cn
to your package.json
.
$ npm install @mariosant/cn
# or
$ yarn add @mariosant/cn
You can now import the module and use it like
import cn from "@mariosant/cn";
Usage
Using cn is pretty simple. It is inspired by the well known Classnames package, but solves a few edge cases.
import cn from '@mariosant/cn';
const isActive = true;
const SomeComponent = () => <Button className={cn('btn', [isActive, 'active', 'inactive'])} .../>
Development
Easy enough! No build required.
$ yarn install # to install dependencies
$ yarn test # to run the test suite
Meta
Marios Antonoudiou – @marios_ant – [email protected]
Distributed under the MIT license.
https://github.com/mariosant/cn
Contributing
- Fork it (https://github.com/mariosant/cn/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes using a semantic commit message.
- Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request