Skip to main content

CnStatusBadge

Color-coded pill badge for status, priority, or category display. Supports automatic variant resolution via colorMap.

Try it

Loading CnStatusBadge playground…

Props

CnStatusBadge showing colored status indicators

PropTypeDefaultDescription
labelString''Display text
variantString'default''default', 'primary', 'success', 'warning', 'error', 'info'
sizeString'medium''small' or 'medium'
solidBooleanfalseUse solid background with white text instead of light background with colored text
colorMapObjectnullMap label values to variants (case-insensitive)

Slots

SlotDescription
defaultCustom label content
#iconIcon element displayed before the label text

Usage

<!-- Manual variant -->
<CnStatusBadge label="Active" variant="success" />

<!-- Solid variant — for use on colored backgrounds -->
<CnStatusBadge label="Active" variant="success" :solid="true" />

<!-- Auto-resolved from colorMap -->
<CnStatusBadge
:label="contact.status"
:colorMap="{
active: 'success',
inactive: 'error',
lead: 'warning',
prospect: 'info',
}" />

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnStatusBadge.vue and update automatically whenever the component changes.

Props

NameTypeRequiredDefaultDescription
labelstring''Badge label text
variantstring'default'Color variant: 'default', 'primary', 'success', 'warning', 'error', 'info'
sizestring'medium'Size: 'small' or 'medium'
solidbooleanfalseUse solid background with white text instead of light background with colored text. Useful when the badge is placed on a colored background (e.g., an active card).
colorMapobjectnullMap of label values to variants. When provided, the variant is resolved from this map using the label (case-insensitive). Falls back to the variant prop. { open: 'success', closed: 'default', overdue: 'error' }

Slots

NameBindingsDescription
default
icon