@mateusz_lisowski/merge-classnames
v1.0.2
Published
Simple javascript library which handle and merge conditional class names
Downloads
3
Maintainers
Readme
@mateusz_lisowski/merge-classnames
Simple package for merging multiple classes where some of the classes are conditionally applied.
It could be used for example in the React project.
No dependencies.
Install
$ npm install @mateusz_lisowski/merge-classnames
Usage
import cx from '@mateusz_lisowski/merge-classnames';
or
const cx = require("@mateusz_lisowski/merge-classnames");
Examples
cx([{ "any-className": true }, "fixed-class"]); // 'any-className fixed-class'
cx([{ "any-className": false }, { "second-className": true }]); // 'second-className'
cx([{ "any-className": false }, { "second-className": false }]); // ''