Clinia UI

Badge

A short status or category label, next to the thing it describes.

shadcn docs →

When to use

  • A status or category next to the thing it describes: Active, Draft, Beta.
  • A count in navigation.

When not to use

  • An action: use Button.
  • A message that needs a sentence: use Alert.

Install

npx shadcn@latest add @clinia/badge
DefaultSecondaryAccentOutlineSuccessWarningDestructive

Clinia rules

  • accent is a Trust outline with text-foreground and no fill. Trust is a 3:1 colour, so it never sits behind label-size text.
  • success, warning and destructive carry status. accent marks something new or featured. outline is neutral metadata.
  • Say the status in words. Colour supports the word, never replaces it.

Do and don't

Synced
Do say the status in words.
Don't rely on colour alone.
Patient intake Draft
Do give each item one badge.
Patient intake DraftNewReviewFR
Don't stack badges that compete for attention.

States

default
Active
secondary
Draft
accent
New
outline
Archived
success
Synced
warning
Pending
destructive
Failed

Toggle the site theme to review both themes.

Accessibility

Built in

  • Renders a <span>, so its focus-visible ring only applies if you make it focusable yourself, such as with tabIndex or by wrapping it in an interactive element.

Your responsibility

  • If a badge is clickable, render a Button or a link instead: a badge is not interactive.
  • Read the badge with its neighbour: Patient intake, Draft should still make sense spoken aloud.

How to test

  1. Toggle the site theme: every variant stays readable in both.
  2. With a screen reader, the badge text is read inline with the text beside it.

API

PropValuesDefaultDescription
variant
defaultsecondaryaccentoutlinedestructivesuccesswarning
default

success, warning and destructive carry status. accent is a Trust outline for something new or featured.

  • default Solid primary fill, for a neutral label.
  • secondary Quiet secondary fill, for a label that sits back.
  • outline Hairline border with no fill, the lightest label.

All other props come from the native span element.