cn-ex
v1.0.0
Published
Utility functions of class string groups and conditionals.
Downloads
8
Maintainers
Readme
cn-ex
The utility functions of class string groups and conditionals.
Required
*React library
*postcss
cn-ex repository
Installation cn-ex:
using npm
npm install cn-ex
using yarn
yarn add cn-ex
Usage
const clNx = cnx(
['class_root', `variant-${variant}`, `size-${props.size}`, !(variant === 'unstyled') && classes.root],
classNames?.root,
className
);
...
// Contoh dengan banyak nilaiPertama dan nilaiKedua
<div className={cnx(['class1', 'class2', clNx], classNames?.root, className, `additionalClass1`, `additionalClass2`)} />
🚨
In practice, some of our syntax/code approach may be incompatible with the library and version you are using.
🏗️
You can join for testing or take part in providing updates.
Contributors
License
MIT License