Badge
A sticker-style label with a candy fill, a white die-cut outline and a tiny edge shadow. Six flavours and an outline.
NewDreamyFreshCalm★ Top pickLimitedOutline
Installation
❯ npx shadcn@latest add https://yan.moe/r/badge.jsonUsage
import { Badge } from "@/components/ui/badge"<Badge variant="mint">Fresh</Badge>Add dot for a twinkling status dot, or asChild to make a link look like a badge:
<Badge dot>New</Badge>
<Badge asChild variant="sky">
<a href="/changelog">v0.2</a>
</Badge>Accessibility
- It renders a plain
<span>, so it is read inline with the surrounding text. - The twinkling dot is
aria-hiddenand stops withprefers-reduced-motion: reduce. - Color is never the only signal: keep the label text meaningful.
API
| Prop | Type | Default |
|---|---|---|
variantCandy flavour. | "default" | "lavender" | "mint" | "sky" | "lemon" | "peach" | "outline" | "default" |
dotShow a twinkling dot before the label. | boolean | false |
asChildMerge props onto the child element instead of rendering a <span>. | boolean | false |