3.0.0 • Published 6 years ago

@lightspeed/cirrus-label v3.0.0

Weekly downloads
3
License
MIT
Repository
-
Last release
6 years ago

This component/package was renamed to Badge to prevent troubles communicating the difference with an input label.

Label

Our basic label 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-label

Or using npm:

npm i -S @lightspeed/cirrus-label

Usage

Import required styles in your .scss:

@import '@lightspeed/cirrus-label/Label.scss';

React Component

Props

PropTypeDescription
childrenReact.ReactNodeThe content to display inside the button
successbooleanDisplay as success label
dangerbooleanDisplay as danger label
infobooleanDisplay as success label
importantbooleanDisplay as important label
warningbooleanDisplay as warning label
smallbooleanDisplay as small label
backgroundColorstringany valid CSS color, i.e: #000000, only use for custom labels
textContraststringlight or dark (use for custom labels with backgroundColor)

Example

import React from 'react';
import Label from '@lightspeed/cirrus-label';

const MyComponent = () =>
  <div>
    <Label>My Label</Label>
  </div>;

export default MyComponent;

CSS Component

Classes

Besides the base class .cr-label you can use one of these classes:

TypeClass
success.cr-label--success
danger.cr-label--danger
info.cr-label--info
important.cr-label--important
warning.cr-label--warning
small.cr-label--small

Example

<span class="cr-label cr-label--info">My Label</span>
3.0.0

6 years ago

2.0.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago