Skip to content

BaseLabel

Badge/label component with customizable background and text colors via CSS variables.

Usage

DefaultPrimaryDanger Featured

<template>
  <div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center">
    <BaseLabel value="Default" />
    <BaseLabel value="Primary" background-color="sc-color-primary" text-color="sc-color-text-on-primary" />
    <BaseLabel value="Danger" background-color="sc-color-danger-bg" text-color="sc-color-danger" />
    <BaseLabel value="Custom slot"><strong>★</strong> Featured</BaseLabel>
  </div>
</template>

Props

PropTypeDefaultDescription
valuestring''Label text (also settable via default slot)
backgroundColorstringsc-color-disabled-bgCSS variable name (without --) for background
textColorstringsc-color-text-secondaryCSS variable name (without --) for text color

Slots

SlotDescription
defaultCustom label content (overrides value prop)

Examples

vue
<BaseLabel value="Default" />
<BaseLabel value="Primary"
  background-color="sc-color-primary"
  text-color="sc-color-text-on-primary"
/>
<BaseLabel value="Danger"
  background-color="sc-color-danger-bg"
  text-color="sc-color-danger"
/>