# @lightspeed/cirrus-tag

> Cirrus Tag Component

Latest version **1.0.4** (published 2019-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lightspeed/cirrus-tag
pnpm add @lightspeed/cirrus-tag
yarn add @lightspeed/cirrus-tag
bun add @lightspeed/cirrus-tag
```

## 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 | 2019-02-26 |
| First published | 2018-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lightspeed |
| Maintainers | ahmedelgabri, anomen, inooid, kshahani, kurt.bergeron, lightspeedhq, ls-frederic-bouchard, ls-guillaume-lambert, tombertrand, x.drdak |

## Links

- npm: https://www.npmjs.com/package/@lightspeed/cirrus-tag
- npm.io page: https://npm.io/package/@lightspeed/cirrus-tag

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [@lightspeed/cirrus-icon](https://npm.io/package/@lightspeed/cirrus-icon.md) ^7.3.0

## Recent versions

- 1.0.4 (latest) — 2019-02-26
- 2.0.0-beta.1 — 2018-12-03
- 2.0.0-beta.0 — 2018-12-03
- 2.0.0-alpha.2 — 2018-11-29
- 2.0.0-alpha.1 — 2018-11-27
- 2.0.0-alpha.0 — 2018-11-26
- 1.0.3 — 2018-10-30
- 1.0.2 — 2018-10-29
- 1.0.1 — 2018-09-06
- 1.0.0 — 2018-08-28
- 0.1.0 — 2018-08-23

## README

# Tag

Tag component.

## Installation

First, make sure you have been through the [Getting Started](https://github.com/lightspeedretail/cirrus#getting-started) steps of adding Cirrus in your application.

If using [Yarn](https://yarnpkg.com/):

```sh
yarn add @lightspeed/cirrus-tag
```

Or using [npm](https://www.npmjs.com/):

```sh
npm i -S @lightspeed/cirrus-tag
```

## Usage

Import required styles in your `.scss`:

```scss
@import '@lightspeed/cirrus-tag/Tag.scss';
```

### React Component

`<Tag />`

| Prop            | Type              | Default       |  Description |
| --------------- | ------------------| ------------- | ------------ |
| `children`      | `node`            | required      | Tag content |
| `size`          | `normal`, `small` | normal        | Tag size |
| `onClick`       | `function`        | () => {}      | Handler called when clicking the Tag |
| `onRemove`       | `function`        | () => {}      | Handler that enables the dismissible functionality and is called when clicking the remove button of the Tag |
| `[property]`    | `any`             | any           | Any extra properties passed will be added to the Tag component |

`<TagLabel />`

| Prop            | Type              | Default       |  Description |
| --------------- | ------------------| ------------- | ------------ |
| `children`      | `node`            | required      | TagLabel content |
| `size`          | `normal`, `small` | normal        | TagLabel size |
| `onClick`       | `function`        | () => {}      | Handler called when clicking the TagLabel |
| `[property]`    | `any`             | any           | Any extra properties passed will be added to the TagLabel component |

`<TagRemove />`

| Prop            | Type              | Default       |  Description |
| --------------- | ------------------| ------------- | ------------ |
| `onClick`       | `function`        | () => {}      | Handler called when clicking the TagRemove |
| `[property]`    | `any`             | any           | Any extra properties passed will be added to the TagRemove component |

#### Example

See the [examples folder](https://github.com/lightspeedretail/cirrus/tree/master/packages/Tag/examples) for this component.

### HTML Component

```html
<div class="cr-tag" role="button" tabIndex="0">
  <div class="cr-tag__label cr-tag__label--small">Tag</div>
  <div class="cr-tag__remove" role="button" tabIndex="0">x</div>
</div>
```

#### Classes

| Type | Class |
| ---- | ----- |
| base | `.cr-tag` |
| label | `.cr-tag__label` |
| label small | `.cr-tag__label--small` |
| label normal | `.cr-tag__label--normal` |
| remove | `.cr-tag__remove` |

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