Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

react-classnames

0.1.2 • Public • Published

ClassNames

Description

A decorator to create add a convenient classNames prop.

Demo

npm start dev then visit http://127.0.0.1:3000

Usage

import classNames from 'react-classnames';
 
@classNames
export default class Demo extends React.Component {
  render() {
    return (
      <div>
        <div classNames='Demo'/>
        <div classNames={ ['main', false && 'hidden', true && 'visible'] } className='other-class'/>
      </div>
    );
  }
};

Customize

Use the factory to customize :

import { factory } from 'react-classtree';
const classes = factory({ propName: 'classes' });

Keywords

none

Install

npm i react-classnames

DownloadsWeekly Downloads

668

Version

0.1.2

License

MIT

Last publish

Collaborators

  • avatar