Badge
Displays a badge or a component that looks like a badge.
Preview
A preview of the Badge component with interactive controls.
Interactive
Installation
Add the Badge component to your project.
ng g @ng-cn/core:c badgeUsage
Import and use the Badge component in your Angular application.
<div class="flex flex-wrap items-center gap-4">
<Badge>Default</Badge>
<Badge variant="secondary">Secondary</Badge>
<Badge variant="destructive">Destructive</Badge>
<Badge variant="outline">Outline</Badge>
</div>Examples
Explore different variations and use cases for the Badge component.
Default
Interactive
API Reference
Props | Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'secondary' | 'outline' | 'destructive' | 'default' | The visual style of the badge. |
class | string | — | Additional CSS classes to apply. |