Badges
Variants, appearances, sizes, icons and counts for the badge component.
Appearances and variants
Subtle is the default: a light background with darker text. Outline has a white background and a coloured ring. Solid is the strongest emphasis. Each appearance has the six variants from the palette. Success, info and warning solid use dark text because white text on these colours does not reach 4.5:1, so keep the text class when you copy them.
Subtle
Outline
Solid
<div>
<h3 class="mb-2 text-sm font-semibold text-dominant-900 dark:text-white">Subtle</h3>
<div class="flex flex-wrap items-center gap-3">
<span
id="badge-1555"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-primary-100 dark:bg-primary-900/50 text-primary-800 dark:text-primary-300 px-2 py-0.5 text-xs"
>
<span>Primary</span>
</span>
<span
id="badge-1612"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-dominant-100 dark:bg-dominant-800 text-dominant-700 dark:text-dominant-300 px-2 py-0.5 text-xs"
>
<span>Dominant</span>
</span>
<span
id="badge-1655"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-success-100 dark:bg-success-900/50 text-success-800 dark:text-success-300 px-2 py-0.5 text-xs"
>
<span>Success</span>
</span>
<span
id="badge-1703"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-info-100 dark:bg-info-900/50 text-info-800 dark:text-info-300 px-2 py-0.5 text-xs"
>
<span>Info</span>
</span>
<span
id="badge-1736"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-warning-100 dark:bg-warning-900/50 text-warning-800 dark:text-warning-300 px-2 py-0.5 text-xs"
>
<span>Warning</span>
</span>
<span
id="badge-1776"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-danger-100 dark:bg-danger-900/50 text-danger-800 dark:text-danger-300 px-2 py-0.5 text-xs"
>
<span>Danger</span>
</span>
</div>
</div>
<div>
<h3 class="mb-2 text-sm font-semibold text-dominant-900 dark:text-white">Outline</h3>
<div class="flex flex-wrap items-center gap-3">
<span
id="badge-1809"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-white dark:bg-dominant-900 text-primary-800 dark:text-primary-200 inset-ring inset-ring-primary-300 dark:inset-ring-primary-700 px-2 py-0.5 text-xs"
>
<span>Primary</span>
</span>
<span
id="badge-1830"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-white dark:bg-dominant-900 text-dominant-700 dark:text-dominant-200 inset-ring inset-ring-dominant-300 dark:inset-ring-dominant-600 px-2 py-0.5 text-xs"
>
<span>Dominant</span>
</span>
<span
id="badge-1847"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-white dark:bg-dominant-900 text-success-800 dark:text-success-200 inset-ring inset-ring-success-300 dark:inset-ring-success-700 px-2 py-0.5 text-xs"
>
<span>Success</span>
</span>
<span
id="badge-1856"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-white dark:bg-dominant-900 text-info-800 dark:text-info-200 inset-ring inset-ring-info-300 dark:inset-ring-info-700 px-2 py-0.5 text-xs"
>
<span>Info</span>
</span>
<span
id="badge-1875"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-white dark:bg-dominant-900 text-warning-800 dark:text-warning-200 inset-ring inset-ring-warning-300 dark:inset-ring-warning-700 px-2 py-0.5 text-xs"
>
<span>Warning</span>
</span>
<span
id="badge-1886"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-white dark:bg-dominant-900 text-danger-800 dark:text-danger-200 inset-ring inset-ring-danger-300 dark:inset-ring-danger-700 px-2 py-0.5 text-xs"
>
<span>Danger</span>
</span>
</div>
</div>
<div>
<h3 class="mb-2 text-sm font-semibold text-dominant-900 dark:text-white">Solid</h3>
<div class="flex flex-wrap items-center gap-3">
<span
id="badge-1904"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-primary-600 text-white px-2 py-0.5 text-xs"
>
<span>Primary</span>
</span>
<span
id="badge-1912"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-dominant-700 dark:bg-dominant-600 text-white px-2 py-0.5 text-xs"
>
<span>Dominant</span>
</span>
<span
id="badge-1925"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-success-500 text-success-950 px-2 py-0.5 text-xs"
>
<span>Success</span>
</span>
<span
id="badge-1934"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-info-500 text-info-950 px-2 py-0.5 text-xs"
>
<span>Info</span>
</span>
<span
id="badge-1944"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-warning-400 text-warning-950 px-2 py-0.5 text-xs"
>
<span>Warning</span>
</span>
<span
id="badge-1953"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-danger-600 text-white px-2 py-0.5 text-xs"
>
<span>Danger</span>
</span>
</div>
</div>
Sizes
Three sizes: small, medium and large. Small is the default. The label is the text prop.
<span
id="badge-1513"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-primary-100 dark:bg-primary-900/50 text-primary-800 dark:text-primary-300 px-2 py-0.5 text-xs"
>
<span>Small</span>
</span>
<span
id="badge-1575"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-primary-100 dark:bg-primary-900/50 text-primary-800 dark:text-primary-300 px-2.5 py-1 text-xs"
>
<span>Medium</span>
</span>
<span
id="badge-1646"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-primary-100 dark:bg-primary-900/50 text-primary-800 dark:text-primary-300 px-3 py-1 text-sm"
>
<span>Large</span>
</span>
Dot and icon
dot or icon puts a dot or an icon before the label. Both are decorative and hidden from assistive tech, so the label must carry the meaning.
<span
id="badge-1514"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-success-100 dark:bg-success-900/50 text-success-800 dark:text-success-300 px-2 py-0.5 text-xs"
>
<span aria-hidden="true" class="size-1.5 bg-current rounded-full"> </span>
<span>Active</span>
</span>
<span
id="badge-1594"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-warning-100 dark:bg-warning-900/50 text-warning-800 dark:text-warning-300 px-2 py-0.5 text-xs"
>
<span aria-hidden="true" class="size-1.5 bg-current rounded-full"> </span>
<span>Pending</span>
</span>
<span
id="badge-1653"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-danger-100 dark:bg-danger-900/50 text-danger-800 dark:text-danger-300 px-2 py-0.5 text-xs"
>
<span aria-hidden="true" class="size-1.5 bg-current rounded-full"> </span>
<span>Failed</span>
</span>
<span
id="badge-1704"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-dominant-100 dark:bg-dominant-800 text-dominant-700 dark:text-dominant-300 px-2 py-0.5 text-xs"
>
<span aria-hidden="true" class="size-1.5 bg-current rounded-full"> </span>
<span>Draft</span>
</span>
<span
id="badge-1742"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-success-100 dark:bg-success-900/50 text-success-800 dark:text-success-300 px-2 py-0.5 text-xs"
>
<i aria-hidden="true" class="fa-solid fa-check"> </i>
<span>Verified</span>
</span>
<span
id="badge-1784"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-info-100 dark:bg-info-900/50 text-info-800 dark:text-info-300 px-2 py-0.5 text-xs"
>
<i aria-hidden="true" class="fa-solid fa-paper-plane"> </i>
<span>Sent</span>
</span>
<span
id="badge-1808"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-warning-100 dark:bg-warning-900/50 text-warning-800 dark:text-warning-300 px-2 py-0.5 text-xs"
>
<i aria-hidden="true" class="fa-solid fa-clock"> </i>
<span>Overdue</span>
</span>
Counts
Put a number next to a label, or on top of an icon button. For the icon button, add visually hidden text that says what the number counts.
<span
class="inline-flex items-center gap-2 text-sm font-medium text-dominant-700 dark:text-dominant-200"
>Inbox
<span
id="badge-1533"
class="inline-flex items-center gap-1.5 rounded-full font-semibold bg-primary-100 dark:bg-primary-900/50 text-primary-800 dark:text-primary-300 px-2 py-0.5 text-xs"
>
<span>128</span>
</span>
</span>
<span class="relative inline-flex">
<button
id="button-1597"
type="button"
aria-label="Notifications, 3 unread"
class="cursor-pointer transition-colors inline-flex items-center justify-center rounded-lg font-semibold group peer focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 dark:focus-visible:ring-offset-dominant-950 bg-dominant-100 dark:bg-dominant-800 text-dominant-700 dark:text-dominant-300 not-disabled:hover:bg-dominant-200 dark:not-disabled:hover:bg-dominant-700 not-disabled:active:bg-dominant-300 focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 size-8 p-0 text-sm"
>
<i aria-hidden="true" class="fa-solid fa-bell"></i>
</button>
<span
aria-hidden="true"
class="pointer-events-none absolute -top-1 -right-1 flex items-center justify-center px-1 h-5 min-w-5 text-xs font-bold text-white bg-danger-600 rounded-full"
>3</span
>
</span>