- Components
- Data display
- Badge
Badge
Displays a badge or a component that looks like a badge.
Badge
default.tsx
Installation
npm
pnpm
yarn
bun
Anatomy
Options
Variant
Use the variant
prop to control the visual style of the Badge
. The default variant is primary
.
neutralaccentsuccessdangerwarninginfo
variants.tsx
Size
Use the size
prop to control the size of the Badge
. The default variant is sm
.
SmallMediumLarge
sizes.tsx
Examples
With icon
BadgeBadgeBadge
icon.tsx
API Reference
Badge accepts all HTML span
element props and the following:
Prop | Type | Default | Description |
---|---|---|---|
neutral | 'neutral' | 'accent' | 'success' | 'warning' | 'info' | 'danger' | The visual style of the badge. | |
size | 'sm' | 'md' | 'lg' | "sm" | The size of the badge. |