shadcn.io is not affiliated with official shadcn/ui
Badge examples · Secondary
Badge with Text (Secondary) for React
A secondary badge with a muted label for neutral information such as Draft or Pending.
Not every badge needs to shout. This React badge uses the Badge component's secondary variant, a muted fill that gives context without pulling attention from the content around it. Use it for draft and pending states, document types, secondary tags or general categories, where a stronger badge would distract from what matters.
Preview
Installation
FAQ
What does variant secondary change?
This badge sets variant="secondary", so it uses the secondary background and secondary-foreground text. That is the muted label.
What are the other badge variants?
default, outline, ghost, link, destructive, info, success and warning. default is the primary fill. destructive, info, success and warning carry those meanings.
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 Text (Standard)A default badge with a short label for a
- Badge with Link (Secondary)A secondary badge rendered as a link that
- Badge with Text (Outline)An outline badge with a bordered label
- Badge with Icon on Left (Secondary)A secondary badge with a star icon before
- Badge with Text (Destructive)A destructive badge for an error, a
- Badge with Icon on Right (Secondary)A secondary badge with a star icon after