Skip to content
SuperCoach

Components · Feedback

Badge

Beta

A short status label, such as Paid or Overdue.

PaidDue in 3 daysOverdueUSD

When to use

  • To show the status of an item in a list or table: an invoice is Paid, a client is Active, a check-in was missed.
  • To label a category or plan: Premium, Online coaching.

When not to use

  • For messages: use an Alert or a Toast.
  • For counts on navigation: use the sidebar's count, not a badge.
  • For actions: badges are not clickable. Use a button or a link.

Anatomy

Paid
  1. 1. Container: pill shape, fill from the variant
  2. 2. Icon (optional), 12px
  3. 3. Label: one or two words

Variants

NewPremiumDraftOverdue
ActiveCheck-in missedOnline coaching AI suggested
VariantUse for
defaultNew or highlighted items
secondaryPlans and tiers; Electric Green in SuperCoach
outlineNeutral labels: Draft, Archived
destructiveProblems that need action: Overdue, Failed
successDone and healthy: Paid, Active, Completed
warningNeeds attention soon: Due in 3 days, Check-in missed
infoNeutral facts: currency, coaching type
aiContent suggested or generated by AI

success, warning, info and ai are SuperCoach extensions to shadcn/ui (SPEC §6). They use the subtle background with the status text color, because white on the solid success and warning fills fails contrast (QUESTIONS Q2). ai has no subtle token, so it is an outline in the AI color.

States

Badges are static: no hover, focus or disabled state. When a badge is inside a link (asChild), the link gets the focus ring.

Usage guidelines

PaidOverdue
Do.The status word carries the meaning; color reinforces it.
Don't.Color dots with no text. Coaches with color vision deficiency can't tell them apart.
  • One badge per item in a list is usually enough. Two at most.
  • Use the same word for the same status across the product.

Content guidelines

  • One or two words, sentence case, no punctuation.
  • Statuses describe the state, not an instruction: "Overdue", not "Pay now".
  • Keep Arabic statuses as short as English: "مدفوعة", "متأخرة".

Accessibility

  • A badge is plain text, read in place: "Invoice 1042, SAR 450, Overdue".
  • Icons inside badges are decorative (aria-hidden); the text says it.
  • All variants pass 4.5:1 in both themes; see the contrast matrix.

RTL

The icon sits before the label, so it moves to the right. Badges don't mirror otherwise.

Tokens used

Read from components/ui/badge.tsx at build time, so this list changes when the component does. Opacity modifiers such as /90 are shadcn hover and focus tints on top of the token.

Semantic color tokens used by this component
TokenUtilitiesSuperCoachCoach
--accentbg-accentbrand-50orange-50
--accent-foregroundtext-accent-foregroundbrand-700orange-700
--aiborder-aiviolet-ai-500violet-ai-500
--ai-foregroundtext-ai-foregroundviolet-ai-700violet-ai-700
--borderborder-borderneutral-200neutral-200
--destructiveborder-destructive ring-destructive/20 bg-destructive bg-destructive/90red-600red-600
--destructive-foregroundtext-destructive-foregroundwhitewhite
--foregroundtext-foregroundneutral-950neutral-950
--infotext-infoblue-700blue-700
--info-subtlebg-info-subtleblue-50blue-50
--primarybg-primary bg-primary/90 text-primarybrand-600orange-500
--primary-foregroundtext-primary-foregroundwhitewhite
--ringborder-ring ring-ring/50brand-600orange-500
--secondarybg-secondary bg-secondary/90lime-300neutral-100
--secondary-foregroundtext-secondary-foregroundneutral-950neutral-800
--success-subtlebg-success-subtlegreen-50green-50
--success-texttext-success-textgreen-700green-700
--warning-subtlebg-warning-subtleamber-50amber-50
--warning-texttext-warning-textamber-800amber-800
  • Radiusrounded-full
  • Typefont-medium
  • Typetext-xs

Props

<Badge>

Also takes every prop of <span>

Badge props
PropTypeDefault
variant"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "success" | "warning" | "info" | "ai""default"
asChild?booleanfalse

Replaces in coach-admin

From the read-only audit of coach-admin: 75 style values, 88 uses.

Classes and selectors

  • .filter-toggle-button-badge10
  • .logo-badge7
  • .sidebar .nav-link .sidebar-todos-count-badge7
  • .badge7
  • .finance-section__deleted-badge5
  • .recommended-badge4
  • .single-record-badge3
  • .vd-bank-status-chip3
  • .sps-badge--missing2
  • .scpay-badge--ready2
  • &.todo-card__priority-badge--high2
  • &.todo-card__priority-badge--low2

SCSS variables in these styles

  • $warning-bg-color→ nearest amber-50 (no semantic token)
  • $light-success-colornot a color: spacing, size or layout
  • $warning-text-color→ --warning-text
  • $success-text-color→ --success-text
  • $success-text-strong→ nearest lime-800 (no semantic token)
  • $danger-border-color→ nearest red-300 (no semantic token)
  • $success-surface-bg→ nearest green-50 (no semantic token)
  • $todo-high-badge-bg→ nearest red-100 (no semantic token)
  • $todo-high-badge-fg→ nearest red-600 (no semantic token)
  • $todo-low-badge-bg→ nearest green-100 (no semantic token)
  • $todo-low-badge-fg→ nearest green-600 (no semantic token)
  • $todo-med-badge-bg→ nearest amber-100 (no semantic token)

Alert, Table, Color.