npm

Need private packages and team management tools?Check out npm Orgs. »

applyclass

1.0.2 • Public • Published

applyClass npm

Conditionally apply CSS classes into your React component

Install

$ npm install applyclass
# or using yarn
$ yarn add applyclass

Usage

const applyClass = require('applyclass')
 
<YourAwesomeComponent className={
  applyClass({
    firstClass: true,
    secondClass: someConditional, // if `true`, class is applied
    thirdClass: false // not applied
  }
)} />
 
// applyClass also works w/ HTML elements
<span className={
  applyClass({
    firstClass: true,
    secondClass: someConditional
  })
} />

API

applyclass(classNames)

classNames

Type: object

The className object to apply into your component

License

MIT © Cezar Augusto

install

npm i applyclass

Downloadsweekly downloads

8

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability