@reframework/classnames
v1.0.3
Published
A tiny JS utility for conditionally joining classNames together.
Downloads
2
Maintainers
Readme
@reframework/classnames
A tiny JavaScript utility for conditionally joining classNames together.
# via npm
npm install @reframework/classnames
# via Yarn
yarn add @reframework/classnames
@reframework/classnames follows the SemVer standard for versioning.
There is also a Changelog.
Usage
The getClassName
function takes an object. If the value associated with a given key is falsy, that key won't be included in the output.
getClassName({ 'foo-bar': true }); // => 'foo-bar'
getClassName({ 'foo-bar': false }); // => ''
LICENSE MIT
Copyright (c) 2022 Reframework.