# component-classes

> Cross-browser element class list

Latest version **1.2.6** (published 2016-04-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install component-classes
pnpm add component-classes
yarn add component-classes
bun add component-classes
```

## 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.2.6 |
| Published | 2016-04-01 |
| First published | 2014-01-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Maintainers | amasad, anthonyshort, calvinfo, clintwood, coreh, cristiandouce, defunctzombie, dfcreative, dominicbarnes, forbeslindesay, hughsk, ianstormtaylor, jonathanong, jongleberry, juliangruber, kelonye, mattmueller, nami-doc, ockham, queckezz, rauchg, retrofox, stagas, stephenmathieson, swatinem, thehydroimpulse, timaschew, timoxley, tjholowaychuk, tootallnate, trevorgerhardt, yields |
| Keywords | dom, html, classList, class, ui |

## Links

- npm: https://www.npmjs.com/package/component-classes
- Repository: https://github.com/component/classes
- Homepage: https://github.com/component/classes#readme
- Issues: https://github.com/component/classes/issues
- npm.io page: https://npm.io/package/component-classes

## Dependencies (1)

- [component-indexof](https://npm.io/package/component-indexof.md) 0.0.3

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.2.6 (latest) — 2016-04-01
- 1.2.5 — 2016-03-10
- 1.2.4 — 2015-03-17
- 1.2.3 — 2014-11-19
- 1.2.2 — 2014-10-27
- 1.2.1 — 2014-02-11
- 1.2.0 — 2014-01-17

## README

# classes

  Cross-browser element class manipulation, utilizing the native `.classList` when possible. This is not designed to be a `.classList` polyfill.

## Installation

```
$ component install component/classes
```

## Example

```js
var classes = require('classes');
classes(el)
  .add('foo')
  .toggle('bar')
  .remove(/^item-\d+/);
```

## API

### .add(class)

  Add `class`.

### .remove(class)

  Remove `class` name or all classes matching the given regular expression.

### .toggle(class)

  Toggle `class`.

### .has(class)

  Check if `class` is present.

### .array()

  Return an array of classes.

## Test

```sh
$ make test
```

## License

  MIT

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