Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bemfy

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bemfy

A simple BEM compose helper

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bemfy NPM JavaScript Style Guide

A stupid simple BEM compose helper to keep your HTML clean.

  • Works with any library/framework.
  • Add and remove independent class names with truthy or falsy value.
  • Fast!
  • Ridiculously tiny at less 500B.
  • No deps

Install

npm install --save bemfy

Usage

import React from 'react';
import bemfy, { c } from 'bemfy'

const Component = () => {
  const b = bemfy("custom-button");

  return <div className={b('wrapper')}>
    <div className={b('text', 'white')}>The lazy cat jumps over dizzy fox</div>
    <button className={b('button', 'primary')}>Jump!</button>
  </div>
}

export default Component;

This will render:

<div class="custom-button__wrapper">
  <div class="custom-button__text--white">The lazy cat jumps over dizzy fox</div>
  <button class="custom-button__button--primary">Jump!</button>
</div>

License

MIT © Eduardo Borges

FAQs

Package last updated on 23 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc