@enrise/bemclassnames
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Build Status

BemClassNames

An utility function for writing simple prefixed classnames.

It is just a wrapper around classnames so you can use every feature from that library.

How to use

The following component:

import React from "react";
import bemClassNames from "bem-class-names";

const cn = bemClassNames("Main");

const Main = () => (
  <div classnames={cn()}>
    <h1 classNames={cn("title")}>The title</h1>
    <div classNames={cn("content")}>The content</div>
  </div>
);

export default Main;

Will result in:

<div class="Main">
    <h1 class="Main-title">The title</h1>
    <div class="Main-content">The content</div>
</div>

Readme

Keywords

Package Sidebar

Install

npm i @enrise/bemclassnames

Weekly Downloads

40

Version

1.0.1

License

MIT

Unpacked Size

3.9 kB

Total Files

5

Last publish

Collaborators

  • enrise