Skip to content

Badge

Data Display

Small status label with color variants: default, secondary, destructive, success, warning, outline.

Six status variants
Open preview

Responsive viewport — resize the window to explore. Direction and density apply only to this preview. Theme applies to the docs too.

Usage

Use badges for short statuses, counts, and metadata. Keep the wording concise and use the same status colors throughout the application.

Import
import { Badge } from "@dashboardpack/core/components/ui/badge";

Available in the included @dashboardpack/core package. Copy the complete example from Source code for all imports and state. Add "use client" when using hooks or event handlers. See installation and theming for project setup.

API reference

Common props and defaults. Slot-specific props are named below; native elements also accept their standard HTML attributes. The component TypeScript definitions are the complete type reference.

Badge props
PropType / DefaultDescription
variantdefault | secondary | destructive | success | warning | outline

Default: default

Semantic badge appearance.
classNamestring

Default: —

Extend spacing or shape.
childrenReactNode

Default: —

The visible status or count.

Build with these too