1.0.1 • Published 4 years ago

@enrise/bemclassnames v1.0.1

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

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>
1.0.1

4 years ago

1.0.0

4 years ago