EN
Getting started
22 · UI elements

Badge

A small, rounded label for showing a status, a category or a count. Used in table cells, card headers and inside buttons.

acun:badge
01

Variants

The color is chosen with variant, using the same palette names as buttons. When omitted, the gray secondary is used. For statuses there are success, warning, danger and info; use primary for labels that do not report a status but should stand out in the main color (such as "New"). solid fills the badge with the color itself and makes the text white. On a screen, always show the same status in the same color (e.g. Active as success everywhere). The old names still work: brand = primary, neutral = secondary.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-2">
    <acun:badge>Draft</acun:badge>
    <acun:badge variant="success">Active</acun:badge>
    <acun:badge variant="warning">Pending</acun:badge>
    <acun:badge variant="danger">Inactive</acun:badge>
    <acun:badge variant="info">Notified</acun:badge>
    <acun:badge variant="primary">New</acun:badge>
    <acun:badge variant="dark">Archived</acun:badge>
</div>
<div class="mt-3 flex flex-wrap items-center gap-2">
    <acun:badge solid>Draft</acun:badge>
    <acun:badge variant="success" solid>Active</acun:badge>
    <acun:badge variant="warning" solid>Pending</acun:badge>
    <acun:badge variant="danger" solid>Inactive</acun:badge>
    <acun:badge variant="info" solid>Notified</acun:badge>
    <acun:badge variant="primary" solid>New</acun:badge>
    <acun:badge variant="dark" solid>Archived</acun:badge>
</div>
PropValues
variantprimary | secondary | success | danger | warning | info | dark
solidtrue | false (filled, white text)
02

With an icon or a dot

Badge content is laid out in a row, so you can put a small acun:icon or a colored dot before the text. The dot does not replace the text for users who cannot tell colors apart; always state the status in words as well.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-2">
    <acun:badge variant="success"><acun:icon name="check-circle" size="3.5" />Delivered</acun:badge>
    <acun:badge variant="danger"><acun:icon name="x-mark" size="3.5" />Canceled</acun:badge>
    <acun:badge variant="success"><span class="size-1.5 rounded-full bg-current"></span>Online</acun:badge>
    <acun:badge><span class="size-1.5 rounded-full bg-current"></span>Offline</acun:badge>
</div>
03

As a counter

To show the number of pending tasks or unread notifications next to a button or a heading, place the badge inside the text.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-3">
    <acun:button variant="white">Awaiting approval <acun:badge variant="danger">12</acun:badge></acun:button>
    <h3 class="flex items-center gap-2 text-sm font-semibold">New orders <acun:badge variant="primary">4</acun:badge></h3>
</div>
API

Props and slots

The values the component accepts.

PropDefaultDescription
variantsecondaryprimary · secondary · success · danger · warning · info · dark (brand = primary, neutral = secondary); an unknown value falls back to secondary
solidfalseFills the badge with the color itself; the text becomes white
Slots: default: the badge text (an icon or a dot can be added).
Acun UI · BadgeDetailed usage and examples