# classes-component

> Cross-browser element class list

Latest version **1.1.3** (published 2013-08-02) · 0 weekly downloads

## Install

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

## 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.1.3 |
| Published | 2013-08-02 |
| First published | 2012-08-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tjholowaychuk |
| Keywords | dom, html, classList, class, ui |

## Links

- npm: https://www.npmjs.com/package/classes-component
- npm.io page: https://npm.io/package/classes-component

## Dependencies (1)

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

## 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.1.3 (latest) — 2013-08-02
- 1.1.2 — 2013-06-10
- 1.1.1 — 2013-05-27
- 1.1.0 — 2013-05-27
- 1.0.0 — 2013-01-08
- 0.0.1 — 2012-08-31

## 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.

## License

  MIT

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