# tt-classnames

> README.md

Latest version **1.0.4** (published 2016-05-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install tt-classnames
pnpm add tt-classnames
yarn add tt-classnames
bun add tt-classnames
```

## 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.4 |
| Published | 2016-05-14 |
| First published | 2016-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.1.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Genert Org |
| Maintainers | genert-org |
| Keywords | classnames, react, trip-trax |

## Links

- npm: https://www.npmjs.com/package/tt-classnames
- Repository: https://github.com/Trip-Trax/tt-classnames
- Homepage: https://github.com/Trip-Trax/tt-classnames#readme
- Issues: https://github.com/Trip-Trax/tt-classnames/issues
- npm.io page: https://npm.io/package/tt-classnames

## 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.4 (latest) — 2016-05-14
- 1.0.3 — 2016-05-14
- 1.0.2 — 2016-05-14
- 1.0.1 — 2016-05-13
- 1.0.0 — 2016-05-13

## README

# tt-classnames

[![Build Status](https://img.shields.io/travis/Trip-Trax/tt-classnames.svg?style=flat-square)](https://travis-ci.org/Trip-Trax/tt-classnames)
[![Coveralls Status](https://img.shields.io/coveralls/Trip-Trax/tt-classnames.svg?style=flat-square)](https://coveralls.io/r/Trip-Trax/tt-classnames)
[![Code Climate](https://codeclimate.com/github/Trip-Trax/tt-classnames/badges/gpa.svg)](https://codeclimate.com/github/Trip-Trax/tt-classnames)
[![NPM Version](https://badge.fury.io/js/tt-classnames.svg)](https://badge.fury.io/js/tt-classnames)

> Utility for joining classNames together with `name` option for BEM styling.

## Installation
```shell
npm install tt-classnames
```

## Usage
```javascript
import TTClassNames from 'tt-classnames';

const classNames = new TTClassNames();

const rootClassName = classNames('test', 123, ['what', 'futura'], {
  'bilder': true,
  'builder': false
});

// rootClassName equals 'test 123 what futura bilder builder'
```

# Usage with React.js
```javascript
import React from 'react';
import TTClassNames from 'tt-classnames';

const classNames = new TTClassNames({
  name: 'tt'
});

export default class Logo extends React.Component {
  render () {
    const currentPage = 'home';

    return (
      <div className={classNames('logo')}>         // className='tt__logo'
        <div className={className('line-1')} />    // className='tt__line-1'
        <div className={className('bg', {          // className='tt__bg tt__yellow'
          'yellow': currentPage === 'home',
          'blue': currentPage === 'about'
        })} />
      </div>
    );
  }
}
```

## Contributions & Issues
Contributions are welcome. Please clearly explain the purpose of the PR and follow the current style.

Issues can be resolved quickest if they are descriptive and include both a reduced test case and a set of steps to reproduce.

## Licence
Licensed under the [MIT License](LICENSE) © Trip-Trax 2015 - present.

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