Badge

Shadcn style badge in seven variants: default, accent, secondary, destructive, outline, ghost and link. Renders as a span or any element, with icon support.

src/registry/ui/badge.tsx/r/badge.json
DefaultSecondaryOutlineDestructive

Variants

Installation#

bash
npx shadcn@latest add @minidev/badge

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/badge.json

Usage#

tsx
import { Badge } from "@/components/ui/badge"

export function Example() {
  return (
    <Badge>Default</Badge>
  )
}

API reference#

Badge props
PropTypeDefault
variant"default" | "accent" | "secondary" | "destructive" | "outline" | "ghost" | "link""default"

Also accepts every prop of <span>, passed through to the root element.

Dependencies#

npm

@base-ui/reactclass-variance-authority

Built from

No other MiniDev files
All alerts, toasts and empty states

Learn more