Skip to content
Componentsstable

Badge

A small pill that labels something — a dance style, an event type, a status. Badges describe; they never act.

Demo

Sold out soon
Workshop
Cuban Salsa
Cancelled
vue
<Badge>Sold out soon</Badge>
<Badge variant="secondary">Workshop</Badge>
<Badge variant="outline">Cuban Salsa</Badge>
<Badge variant="destructive">Cancelled</Badge>

Variants

Four variants. Pick by meaning, not by which colour looks nicest next to the photo.

default
Sold out soon

The one thing on the card that needs attention. Red — use sparingly.

secondary
Workshop

Category or type labels: workshop, social, festival, concert.

outline
Cuban Salsa

Neutral tags — dance styles, levels, cities. Safe to show many at once.

destructive
Cancelled

Something went wrong or is no longer available.

With an icon

A leading 12px icon adds scannability on busy event cards. The badge already sets the gap.

12 tickets left
Early bird
In your plan
Postponed
vue
<script setup lang="ts">
import { Flame, Ticket } from 'lucide-vue-next'
</script>

<template>
  <Badge><Flame class="w-3 h-3" aria-hidden="true" /> 12 tickets left</Badge>
  <Badge variant="secondary"><Ticket class="w-3 h-3" aria-hidden="true" /> Early bird</Badge>
</template>

In context

Dance-style tags on an event row: outline badges, wrapping freely at phone width.

Fri · 21:00
Salsa Night at La Rumba
Social
Cuban Salsa
Bachata
Timba
Rueda de Casino
vue
<div class="flex flex-wrap gap-1.5">
  <Badge v-for="style in event.styles" :key="style" variant="outline">
    {{ style }}
  </Badge>
</div>

Props

PropTypeDefaultDescription
variant'default' | 'secondary' | 'destructive' | 'outline''default'Colour treatment. See Variants for when to use each.
classHTMLAttributes["class"]—Extra classes, merged with cn() — later classes win, so you can override padding or colour.
default slotslot—Label text, optionally with a leading 12px Lucide icon. Keep it to one to three words.

Do & don't

Sold out soon
Bachata
Beginner

Do — One red badge per card at most, for the thing that needs attention now.

Hot
New
Popular
Bachata

Don't — Stack several red badges — when everything shouts, nothing is urgent.

Workshop
Cancelled

Do — Short labels: one to three words a dancer can scan on the floor.

This event was cancelled by the organiser yesterday

Don't — Sentences in a badge. Put explanations in body text instead.

Accessibility

  • Badge renders a plain <div> — it is not focusable and not interactive. Never put a click handler on it; if it filters or toggles, use a Button (a filter chip pattern is planned).
  • Colour is never the only signal: the label must say what the colour means (“Cancelled”, not a red dot).
  • Icons inside a badge are decorative — mark them aria-hidden="true" so screen readers read the label once.
  • Text is 12px semibold, so it needs 4.5:1. default (white on red, ~4.8:1), secondary and outline pass. destructive — red text on a 10% red tint — measures ~4.1:1 and is below AA; keep its label short and redundant with surrounding text until the variant is fixed. Never place badges on photos without a solid backing.