Badge

Labels an item with a short status or category.

@paneui/theme@base-ui/reactclass-variance-authority
CCone King7 daysFastNeeds reviewNo signalDraft

Installation

pnpm dlx shadcn@latest add @paneui/badge

Usage

Examples

Sizes

With Icon

Put an icon first when the badge marks a status or category.

With Avatar

API Reference

Badge

Also accepts every prop of span.

variant= "chip"
"chip" | "primary" | "success" | "warning" | "destructive" | "outline"
Visual style. chip is neutral; the tinted variants carry status.
size= "default"
"default" | "sm"
Height, padding and text size. default is 28px tall and sm 20px; icons are 14px, or 12px at sm.
render
ReactElement | (props, state) => ReactElement
Replace the rendered <span>, e.g. with <a /> or a router Link.
PropTypeDefaultDescription
variant"chip" | "primary" | "success" | "warning" | "destructive" | "outline""chip"Visual style. chip is neutral; the tinted variants carry status.
size"default" | "sm""default"Height, padding and text size. default is 28px tall and sm 20px; icons are 14px, or 12px at sm.
renderReactElement | (props, state) => ReactElement—Replace the rendered <span>, e.g. with <a /> or a router Link.

BadgeAvatar

Small round mark at the start of a badge, e.g. a vendor initial. Also accepts every prop of span.

badgeVariants

The cva function behind Badge, for styling other elements like a badge.

variant
same as Badge
size
same as Badge
PropTypeDefaultDescription
variantsame as Badge—
sizesame as Badge—