Badge
A short status or category label, next to the thing it describes.
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/badgeDefaultSecondaryAccentOutlineSuccessWarningDestructive
Clinia rules
accentis a Trust outline withtext-foregroundand no fill. Trust is a 3:1 colour, so it never sits behind label-size text.success,warninganddestructivecarry status.accentmarks something new or featured.outlineis neutral metadata.- Say the status in words. Colour supports the word, never replaces it.
Do and don't
Synced
Patient intake Draft
Patient intake DraftNewReviewFR
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 withtabIndexor 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, Draftshould still make sense spoken aloud.
How to test
- Toggle the site theme: every variant stays readable in both.
- With a screen reader, the badge text is read inline with the text beside it.
API
| Prop | Values | Default | Description |
|---|---|---|---|
| variant | defaultsecondaryaccentoutlinedestructivesuccesswarning | default |
|
All other props come from the native span element.