Nonstop Perpetual Motion

    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

    2

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    2.48 kB

    Total Files

    4

    Last publish

    Collaborators

    • cezaraugusto