Skip to content

oeri-org/cn-ex

Repository files navigation

cn-ex

The utility functions of class string groups and conditionals.

Required

*

Installation cn-ex:

using npm

npm install cn-ex

using yarn

yarn add cn-ex

Usage

import { cnx } from 'cn-ex';
// const { cnx}  = require('cnx');

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

Become a contributor

License

MIT License

© ioeridev

About

The utility functions of class string groups and conditionals.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors