shadcn.io is not affiliated with official shadcn/ui
Badge examples · Outline
Badge with Text (Outline) for React
An outline badge with a bordered label for tags, categories and other quiet metadata.
A border without a fill keeps an interface clean. This React badge uses the Badge component's outline variant for information that matters but doesn't need attention right away: a thin border, no background and text in the foreground color. Use it for tags, categories and metadata labels that should be present without being prominent.
Preview
Installation
FAQ
What does variant outline draw?
variant="outline" sets a border-border edge and text-foreground. It leaves the background unset, so the page shows through the badge.
Which variants add a fill?
default and secondary fill the badge. destructive, info, success and warning fill it and set the meaning. ghost and link are the other values.
How do I change the size or round it fully?
size takes sm, md or lg. pill rounds the badge fully. This demo sets neither, so you get the normal label.
Why doesn't the label wrap?
The badge is whitespace-nowrap, so the label stays one line. Shorten the text. A sentence belongs in an Alert.
Related
- Badge with Link (Outline)An outline badge rendered as a link that
- Badge with Icon on Left (Outline)An outline badge with a star icon before
- Badge with Text (Standard)A default badge with a short label for a
- Badge with Text (Secondary)A secondary badge with a muted label for
- Circular Badge with Count (Outline)A circular outline badge showing a number
- Badge with Text (Destructive)A destructive badge for an error, a