Labels are a visual pattern used to categorize information providing quick and easy recognition.

installyarn add @clayui/label
versionNPM Version
useimport Label from '@clayui/label';

Colors

PrimarySecondaryInfoWarningDangerSuccessLightDark

Snippet

PrimarySecondaryInfoWarningDangerSuccessLightDark

Snippet

Label Variant Sass API

The map $label-palette allows generating any number of label variants. If a key starts with ., #, or % Clay will output it as is, otherwise we will prepend .label- to the key (e.g., .label-primary). It will also generate a Sass placeholder prefixed by %label- (e.g., %label-primary).

Snippet

Outputs:

Snippet

Sizes

Use label-lg to make the label larger, or use the mixin label-size($sassMap) to create a custom sized label:

Normal LabelLarge Label

Snippet

Label Size Sass API

The map $label-sizes allows generating any number of label size variants. If a key starts with ., #, or % Clay will output it as is, otherwise it will prepend . to the key (e.g., .label-lg). It will also generate a Sass placeholder prefixed by % (e.g., %label-lg).

Snippet

Outputs:

Snippet

Variations

Simple

Simple Label

Snippet

Dismissible

Snippet

Snippet

Interactive

Add the tabindex="0" attribute to the .label element to create an interactive label with multiple controls inside. The inner controls should have the attribute tabindex="-1" to remove them from the tab order. The inner controls can be placed back in the tab order by changing back to tabindex="0" with javascript.

Implementing Interactive Labels require custom javascript.

Snippet

Anchor Tag

Snippet

Edit this page on GitHub

Contributors

Matuzalém Teles

Last edited May 12, 2025 at 7:56:02 PM