The badge component is commonly used to complement other elements such as buttons or text elements to become a label or to show the data counter, such as the number of comments, etc.

As an alternative, badges can also be used as standalone elements that link to particular pages by using anchor elements instead of span.

Overviews

These are some overviews of the badges. Use the options to switch between various styles and variants.

Badges

Variants
With

Basic Usage

You only need an element with a badge class to create a badge.

Badge

Color Schemes

To change the color schemes, use Skewind's scheme-{color} utility classes. You can also switch to a softer scheme by appending the badge--soft class to the alert element. Take a look at these examples:

Primary Gray Success Warning Danger Info Color Indigo
Primary Gray Success Warning Danger Info Color Indigo

Badge Variants

The badge variant is badge--default by default just like the above examples. We provide a few more variants that are listed below. Append badge--{style} class to set button variant.

Outline

badge--outline
Primary Gray Success Warning Danger Info Color Indigo

Softer Outline

badge--outline badge--soft
Primary Gray Success Warning Danger Info Color Indigo

Flat

badge--flat
Primary Gray Success Warning Danger Info Color Indigo

Softer Flat

badge--flat badge--soft
Primary Gray Success Warning Danger Info Color Indigo

More Examples

With Icons

Let's add some icons to make it look more interesting. Wrap the badge text with an element. And finally, add the icon element as the first or/and last child of the badge. For example:

Left Right Left & Right

                            

Icon Only

Sometimes you need a badge as a label using only an icon. Use the badge--icon class.


                            

With Dot

You can even attach the dot to the badge element if you prefer to. Use the badge--dot class.

Dot Dot Dot

                            

Within Button

Use the badge as a counter to complement the button. Checkout the example code.

As an Icon Badge

Use the badge as a counter to complement the icons. Checkout the example code.

9 9 9

                            

Badge Pills

You can also use the TailwindCSS rounded-full utility to make pill-shaped buttons.

Solid Pill Outline Pill Flat