Badge

PreviousNext

Displays a badge for highlighting important information.

Component badge-demo not found in registry.

Installation

pnpm dlx shadcn@latest add badge

Usage

import * as Badge from "@/components/ui/badge"
<Badge.Root variant="filled" color="blue">
  Badge
</Badge.Root>

Examples

Sizes

Component badge-sizes not found in registry.

Colors

Component badge-colors not found in registry.

With Icon

Component badge-with-icon not found in registry.

With Dot

Component badge-with-dot not found in registry.

Circle

Component badge-circle not found in registry.

Closable

Component badge-closable not found in registry.

Disabled

Component badge-disabled not found in registry.

Props

Badge.Root

This component is based on a <span> element and supports all of its props.

Prop

Type

Default

variant
primary
secondary
danger
success
warning
primary
appearance
filled
bordered
muted
ghost
filled
size
xs
sm
md
lg
md
circle
boolean
false
disabled
boolean
false
asChild
boolean
false
className
string
-
children
ReactNode
-