# classname-manipulator

> classname-manipulator

Latest version **1.0.0** (published 2015-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install classname-manipulator
pnpm add classname-manipulator
yarn add classname-manipulator
bun add classname-manipulator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-07-05 |
| First published | 2015-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexey Litvinov |
| Maintainers | sullenor |
| Keywords | className, react |

## Links

- npm: https://www.npmjs.com/package/classname-manipulator
- Repository: https://github.com/sullenor/classname-manipulator
- Issues: https://github.com/sullenor/classname-manipulator/issues
- npm.io page: https://npm.io/package/classname-manipulator

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-07-05

## README

classname-manipulator
=====================

A simple javascript utility for building classNames. It's like [classnames](https://www.npmjs.com/package/classnames) utility, however it allows you to use bem-naming notation and [css-modules](https://github.com/css-modules/css-modules).

## Usage

This utility was designed to be used with React components and helps you to build classNames for the components in an easier way. It uses certain properties: `className`, `childName`, `theme`.

Plain example:

```javascript
'use strict';

var cm = require('classname-manipulator');

var props = {
  className: 'button',
  theme: {action: true}
};

cm(props); // 'button button--action'
```

Using react and css-modules:

```jsx
'use strict';

import cm from 'classname-manipulator';
import styles from './Button.css';

class Button {
  render() {
    var classes = cm(this.props, styles);
    return (
      <Button className={classes}>
        {this.props.children}
      </Button>
    );
  }
}
```

---
_Source: https://npm.io/package/classname-manipulator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
