# react-subclass

> React CSS subClass

Latest version **0.0.6** (published 2015-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-subclass
pnpm add react-subclass
yarn add react-subclass
bun add react-subclass
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2015-09-24 |
| First published | 2015-09-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Julien De Luca |
| Maintainers | jide |

## Links

- npm: https://www.npmjs.com/package/react-subclass
- Repository: https://github.com/jide/react-subclass
- Issues: https://github.com/jide/react-subclass/issues
- npm.io page: https://npm.io/package/react-subclass

## Dependencies (1)

- [react](https://npm.io/package/react.md) 0.13.x

## Recent versions

- 0.0.6 (latest) — 2015-09-24
- 0.0.5 — 2015-09-18
- 0.0.4 — 2015-09-18
- 0.0.3 — 2015-09-18
- 0.0.2 — 2015-09-18

## README

## subClass

### Description
A decorator to create CSS subclasses, like a simple BEM, for React.

### Demo
`npm start dev` then visit http://127.0.0.1:3000

### Usage
```js
import subClass from 'react-subclass';

@subClass
class App extends React.Component {
  render() {
    return (
      <div>
        <div subClass='main'>
          <div subClass='title'>
            Hello !
          </div>
        </div>
        <div subClass='aside'>
          Aside
        </div>
      </div>
    );
  }
}
```

### Yields
```html
<div class='Demo'>
  <div class='Demo__main'>
    <div class='Demo__title'>
      Hello !
    </div>
  </div>
  <div class='Demo__aside'>
    Aside
  </div>
</div>
```

### Customize
Use the factory to customize :
```js
import { factory } from 'react-subclass';
const myDecorator = factory({ separator: '--', propName: 'cx' });
```

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