GitHub

Badge

A badge or an element styled as a badge.

Favorite

Installation

Usage

Variants

You can change the variant of the badge using the variant prop.

Solid

Badge

Secondary

Badge

Outline

Badge

Success

Badge

Info

Badge

Warning

Badge

Destructive

Badge

Sizes

You can change the size of the badge using the size prop.

Small

Badge

Large

Badge

Pill

You can use the pill prop to create fully rounded badges.

Badge

Examples

You can use asChild prop on <Badge /> to make another element styled as a badge.

Custom color

You can use the className prop to add custom colors to the badge.

IndigoPinkSkyPurple

With icon

You can add icons to badges to provide visual context.

Favorite

With spinner

You can add a <Spinner /> to badges to indicate loading states.

DeletingGenerating

With count

Badges can display counts or numbers for notifications and indicators.

3

API Reference

Badge

Root element of the badge. Renders a span