Twitter2.3k

Badge

Makes a component look like a badge.

BadgeSecondaryDestructiveOutline

Installation

ng g @spartan-ng/cli:ui badge

Usage

import { HlmBadgeImports } from '@spartan-ng/helm/badge';
<span hlmBadge variant="default | outline | secondary | destructive">Badge</span>

Examples

Variants

Use the variant prop to change the variant of the badge.

BadgeSecondaryDestructiveOutlineGhost

With Icon

You can render an icon inside the badge.

Verified Bookmark

With Spinner

You can render a spinner inside the badge.

Verified Bookmark

Custom Colors

You can customize the colors of a badge by adding custom classes such as bg-blue-50 and text-blue-700 to the hlmBadge component.

BlueGreenSkyPurpleRed

Helm API

HlmBadge

Selector: [hlmBadge],hlm-badge

Inputs

PropTypeDefaultDescription
variant BadgeVariants['variant'] default -
Breadcrumb Avatar