Elements

Badge

A short label that shows a status, a category or a count.

Usage

Label

Use the label prop to set the text of the badge. The default slot replaces it.

Pending
<KBadge label="Pending" />

Variant

Use the variant prop to change the look of the badge: soft (default), solid or outline.

PaidPaidPaid
<KBadge label="Paid" color="success" />
<KBadge label="Paid" color="success" variant="solid" />
<KBadge label="Paid" color="success" variant="outline" />

Color

Use the color prop to change the color of the badge: gray (default), secondary, success, warning, danger, info or discovery.

PendingBetaPaidDue soonOverdueNewBeta
<KBadge label="Pending" />
<KBadge label="Beta" color="secondary" />
<KBadge label="Paid" color="success" />
<KBadge label="Due soon" color="warning" />
<KBadge label="Overdue" color="danger" />
<KBadge label="New" color="info" />
<KBadge label="Beta" color="discovery" />

Size

Use the size prop to change the size of the badge: sm (default), md or lg.

PaidPaidPaid
<KBadge label="Paid" color="success" />
<KBadge label="Paid" color="success" size="md" />
<KBadge label="Paid" color="success" size="lg" />

Pill

Badges have rounded corners that follow the size by default. Set pill to make them fully round.

OverdueOverdue
<KBadge label="Overdue" color="danger" variant="outline" size="md" />
<KBadge label="Overdue" color="danger" variant="outline" size="md" pill />

Dot

Set dot to show a small dot before the label, in the color of the text. It suits live statuses.

ActivePausedFailed
<KBadge label="Active" color="success" size="md" pill dot />
<KBadge label="Paused" size="md" pill dot />
<KBadge label="Failed" color="danger" size="md" pill dot />

Icon

Use the leading-icon and trailing-icon props to show an icon before or after the label. They take a Lucide icon component.

12.5%3.2%VerifiedRecurringPro
<script setup lang="ts">
import { BadgeCheck, Repeat, Sparkles, TrendingDown, TrendingUp } from 'lucide-vue-next'
</script>

<template>
  <KBadge label="12.5%" color="success" size="md" pill :leading-icon="TrendingUp" />
  <KBadge label="3.2%" color="danger" size="md" pill :leading-icon="TrendingDown" />
  <KBadge label="Verified" color="info" size="md" :leading-icon="BadgeCheck" />
  <KBadge label="Recurring" variant="outline" size="md" :leading-icon="Repeat" />
  <KBadge label="Pro" color="discovery" variant="solid" size="md" :trailing-icon="Sparkles" />
</template>

Customization

Use the ui prop to change the classes of each part of the badge, and class for the root element. Your classes always win: rounded-none replaces the default rounded-sm instead of being added to it.

Square corners
<KBadge label="Square corners" :ui="{ base: 'rounded-none' }" />

API

Props

PropTypeDefault
labelstring
variant'soft' | 'solid' | 'outline''soft'
color'gray' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'discovery''gray'
size'sm' | 'md' | 'lg''sm'
leadingIconComponent
trailingIconComponent
dotbooleanfalse
pillbooleanfalse
ui{ base?, dot?, leadingIcon?, trailingIcon? }
classstring

Slots

SlotDescription
defaultReplaces the label.
Copyright © 2026