PU-Badge Component

A customizable badge component with support for icons and different severity styles.

Usage

Basic Usage

New Feature
With Icon

All Variants

Primary
Secondary
Ghost
PropTypeRequiredDescription
labelstringYesText displayed inside the badge
iconstringNoIcon name (requires PUIcon component)
severityprimary | secondary | ghostNoBadge color variant (default: primary)
VariantClassesDescription
Primaryborder-primary-light-500 bg-primary-light-500 text-primary-dark-50Solid badge with primary colors (Default)
Secondaryborder-primary-light-200 bg-primary-light-200 text-primary-light-500Subtle badge with secondary colors
Ghostbg-transparent text-primary-light-500Transparent background with text and border
  • Uses font-patrick font family class
  • Base styles applied with Tailwind-like utilities:
    .pu-badge--default {
      @apply w-fit text-xs p-1 rounded-lg flex justify-between gap-2 items-center border-2;
    }
    
  • Colors are dynamically applied based on severity prop
  • Customizable through CSS variables or overriding the style classes
  • Requires PUIcon component for icon display
  • Uses Tailwind CSS (or compatible utility framework) for styling ::