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', and the two board tones without a Nextcloud role: 'purple' (work in progress, such as "In behandeling") and 'teal' (handed on, such as "Omgezet naar een zaak"). The board tones read the tokens --cn-status-purple-bg, --cn-status-purple-text, --cn-status-teal-bg and --cn-status-teal-text, which a theme may redefine. Under the board look a primary pill takes --color-primary-element-light-text as its text colour.
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)
colorKeyString''Look this up in colorMap instead of the label. Use it when the label is translated but the map is keyed on the raw value (e.g. a schema enum code) — otherwise a translated label matches nothing and the badge falls back to variant.

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.

OpenRegister reliance​

none: this component does not touch OpenRegister, directly or through anything it imports. 0 direct references, 0 files reached through imports.

See the reliance overview for the filterable list.

Props​

NameTypeRequiredDefaultDescription
labelstring''Badge label text
variantstring'default'Color variant: 'default', 'primary', 'success', 'warning', 'error', 'info', or one of the two board tones without a Nextcloud role, 'purple' (work in progress) and 'teal' (handed on).
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' }
colorKeystring''Key to look up in colorMap instead of the label. Set this when the label is a translated/display string but the map is keyed on the raw value (e.g. a schema enum code) — without it a translated label misses every map entry and the badge silently falls back to variant.

Slots​

NameBindingsDescription
default—
icon—