JSPM

@reframework/classnames

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 107
  • Score
    100M100P100Q42761F
  • License MIT

A tiny JS utility for conditionally joining classNames together.

Package Exports

  • @reframework/classnames
  • @reframework/classnames/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@reframework/classnames) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@reframework/classnames

A tiny JavaScript utility for conditionally joining classNames together.

Install with npm or Yarn:

# 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.