A small status label with semantic color variants.
A small status label with semantic color variants.
Variants
1<div style={{ display: "flex", gap: "8px", flexWrap: "wrap" }}>2 <Badge variant="default">Default</Badge>3 <Badge variant="primary">Primary</Badge>4 <Badge variant="success">Success</Badge>5 <Badge variant="warning">Warning</Badge>6 <Badge variant="error">Error</Badge>7 <Badge variant="info">Info</Badge>8</div>
Sizes
1<div style={{ display: "flex", gap: "8px", alignItems: "center" }}>2 <Badge variant="primary" size="sm">3 Small4 </Badge>5 <Badge variant="primary" size="md">6 Medium7 </Badge>8</div>
Examples
Open all 7 →Default Badge
1const DefaultBadge = () => <Badge variant="default">Default</Badge>;23render(<DefaultBadge />);
Primary Badge
1const PrimaryBadge = () => <Badge variant="primary">Primary</Badge>;23render(<PrimaryBadge />);
Properties
Badge props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Content to render inside the badge |
className | string | — | Additional class names to merge with the component root element |
size | "sm" | "md" | md | Controls the size; defaults to md |
variant | "default" | "primary" | "success" | "warning" | "error" | "info" | default | Controls the color scheme; defaults to default |
Also accepts the native attributes of its root element (className, aria-*, event handlers, …).