1.0.4 • Published 5 years ago

@lightspeed/cirrus-tag v1.0.4

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

Tag

Tag component.

Installation

First, make sure you have been through the Getting Started steps of adding Cirrus in your application.

If using Yarn:

yarn add @lightspeed/cirrus-tag

Or using npm:

npm i -S @lightspeed/cirrus-tag

Usage

Import required styles in your .scss:

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

React Component

<Tag />

PropTypeDefaultDescription
childrennoderequiredTag content
sizenormal, smallnormalTag size
onClickfunction() => {}Handler called when clicking the Tag
onRemovefunction() => {}Handler that enables the dismissible functionality and is called when clicking the remove button of the Tag
[property]anyanyAny extra properties passed will be added to the Tag component

<TagLabel />

PropTypeDefaultDescription
childrennoderequiredTagLabel content
sizenormal, smallnormalTagLabel size
onClickfunction() => {}Handler called when clicking the TagLabel
[property]anyanyAny extra properties passed will be added to the TagLabel component

<TagRemove />

PropTypeDefaultDescription
onClickfunction() => {}Handler called when clicking the TagRemove
[property]anyanyAny extra properties passed will be added to the TagRemove component

Example

See the examples folder for this component.

HTML Component

<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

TypeClass
base.cr-tag
label.cr-tag__label
label small.cr-tag__label--small
label normal.cr-tag__label--normal
remove.cr-tag__remove
1.0.4

5 years ago

2.0.0-beta.1

5 years ago

2.0.0-beta.0

5 years ago

2.0.0-alpha.2

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago