shadcn.io is not affiliated with official shadcn/ui
Badge examples · Destructive
Badge with Text (Destructive) for React
A destructive badge for an error, a failure or another state that needs fixing.
Red means something is wrong. This React badge uses the Badge component's destructive variant for errors and urgent warnings: the label takes your theme's destructive color on a light tint of the same color. Use it for failed statuses, error counts, critical alerts and overdue tasks, any negative state that should be recognized at a glance.
Preview
Installation
FAQ
What color does variant destructive use?
variant="destructive" sets text-destructive on bg-destructive/10, and dark:bg-destructive/20 in dark mode. The word still has to name the problem, such as Error or Failed.
Which variant is for a success or a warning?
success and warning, plus info. secondary and outline stay neutral. default, ghost and link are the other values.
When should this be an alert instead?
Use the badge for a short status beside other content. Use an Alert when you need a sentence about what failed and what to do next.
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.
Related
- Badge with Link (Destructive)A destructive badge rendered as a link
- Badge with Icon on Left (Destructive)A destructive badge with a star icon
- Badge with Text (Outline)An outline badge with a bordered label
- Badge with Text (Standard)A default badge with a short label for a
- Error with Title AlertA destructive alert with only a title
- Circular Badge with Count (Destructive)A circular destructive badge showing a