classnames-plus
A simple JavaScript utility for conditionally joining classNames together.
Install with npm, Bower, or Yarn:
npm:
npm install classnames-plus --save
Bower:
bower install classnames-plus --save
Yarn (note that yarn add
automatically saves the package to the dependencies
in package.json
):
yarn add classnames-plus
Use with Node.js, Browserify, or webpack:
Old functions are still available:
var classNamesPlus = ;; // => 'foo bar'
add functions:
var classNamesPlus = ;var tabActiveIndex = 0;var result = ;console; // => 'btn btn-over fun-plus active'
in React:
{ superprops thisstate = tabActiveIndex: 0 } { this } { return <ul> <li className= onClick=thishandleClick>css </li> <li className= onClick=thishandleClick>javascript </li> <li className= onClick=thishandleClick>html </li> </ul> ; } ;
License
MIT. Copyright (c) 2018 Xu Tongbao.