|$ curl https://forge-ai.dev/api/markdown?path=docs/components/badges
$cat docs/badges-&-tags.md
updated Recently·14 min read·published

Badges & Tags

CSSHTMLTailwindBootstrapUIIntermediate🎯Free Tools
Introduction

Badges and tags are compact status and labeling elements. This guide covers production-ready patterns in plain HTML/CSS, Tailwind CSS, and Bootstrap — including color variants, outline styles, sizes, status dots, notification counts, removable chips, pill badges, and accessibility.

info

Use a real <span> for badges rather than clickable divs. For interactive chips, use <button> with an accessible name and a visible focus indicator.
Color Variants

Six semantic color variants for labels, status, and metadata.

variants
Live
untitled.html
HTML
1<div class="g">
2 <span class="b primary">
3 Primary
4 </span>
5 <span class="b success">
6 Success
7 </span>
8 <span class="b warning">
9 Warning
10 </span>
11 <span class="b danger">
12 Danger
13 </span>
14 <span class="b info">
15 Info
16 </span>
17 <span class="b neutral">
18 Neutral
19 </span>
20</div>
preview
Outline Variants

Border-only badges for a lighter visual footprint on dark surfaces.

outline
Live
untitled.html
HTML
1<div class="g">
2 <span class="b primary">
3 Primary
4 </span>
5 <span class="b success">
6 Success
7 </span>
8 <span class="b warning">
9 Warning
10 </span>
11 <span class="b danger">
12 Danger
13 </span>
14 <span class="b info">
15 Info
16 </span>
17</div>
preview
Sizes

Small, default, and large badges to match surrounding text density.

sizes
Live
untitled.html
HTML
1<div class="g">
2 <span class="b sm">
3 Small
4 </span>
5 <span class="b md">
6 Default
7 </span>
8 <span class="b lg">
9 Large
10 </span>
11</div>
preview
Dot Badges

Status indicator dots for online, offline, away, and busy states.

dot
Live
untitled.html
HTML
1<div class="g">
2 <span class="dot on">
3 </span>
4 <span class="label">
5 Online
6 </span>
7 <span class="dot off">
8 </span>
9 <span class="label">
10 Offline
11 </span>
12 <span class="dot away">
13 </span>
14 <span class="label">
15 Away
16 </span>
17 <span class="dot busy">
18 </span>
19 <span class="label">
20 Busy
21 </span>
22</div>
preview
Count Badges

Notification counts positioned on icons and buttons.

count
Live
untitled.html
HTML
1<div class="g">
2 <div class="icon-wrap">
3 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" style="color:#A0A0A0">
4 <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"/>
5 <path d="M13.73 21a2 2 0 0 1-3.46 0"/>
6 </svg>
7 <span class="count">
8 3
9 </span>
10 </div>
11 <div class="icon-wrap">
12 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="24" height="24" style="color:#A0A0A0">
13 <path d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z"/>
14 <path d="M12 6v6l4 2"/>
15 </svg>
16 <span class="count dot-only">
17 </span>
18 </div>
19 <button class="btn">
20 Inbox
21 <span class="c">
22 12
23 </span>
24 </button>
25</div>
preview
Tags / Chips

Removable tags and filter chips with a close affordance.

tags
Live
untitled.html
HTML
1<div class="g">
2 <span class="tag">
3 React
4 <span class="close">
5 &times;
6 </span>
7 </span>
8 <span class="tag">
9 TypeScript
10 <span class="close">
11 &times;
12 </span>
13 </span>
14 <span class="tag">
15 CSS
16 <span class="close">
17 &times;
18 </span>
19 </span>
20 <span class="tag">
21 Tailwind
22 <span class="close">
23 &times;
24 </span>
25 </span>
26 <span class="add">
27 + Add tag
28 </span>
29</div>
preview
Pill & Special Effects

Gradient fills, glows, glassmorphism, and bordered pills for premium surfaces.

pill-badges
Live
untitled.html
HTML
1<div class="g">
2 <span class="b gradient">
3 Premium
4 </span>
5 <span class="b glow">
6 New
7 </span>
8 <span class="b glass">
9 Beta
10 </span>
11 <span class="b border">
12 Pro
13 </span>
14</div>
preview
With Icons

Badges paired with inline SVG icons for clearer meaning.

with-icons
Live
untitled.html
HTML
1<div class="g">
2 <span class="b">
3 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" width="12" height="12">
4 <polyline points="20 6 9 17 4 12"/>
5 </svg>
6 Verified
7 </span>
8 <span class="b warn">
9 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" width="12" height="12">
10 <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>
11 <line x1="12" y1="9" x2="12" y2="13"/>
12 <line x1="12" y1="17" x2="12.01" y2="17"/>
13 </svg>
14 Warning
15 </span>
16 <span class="b danger">
17 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" width="12" height="12">
18 <circle cx="12" cy="12" r="10"/>
19 <line x1="15" y1="9" x2="9" y2="15"/>
20 <line x1="9" y1="9" x2="15" y2="15"/>
21 </svg>
22 Failed
23 </span>
24</div>
preview
Accessibility

Badges are small but must remain readable and meaningful. Pair color with text or an icon, and ensure interactive chips behave like real controls.

  • Use sufficient contrast between badge text and background; do not rely on color alone.
  • Icon-only badges need an aria-label or visually hidden text.
  • Removable chips should use a <button> with an accessible name like "Remove React".
  • Status dots should include a visible text label or an aria-label such as "Status: online".
  • Notification counts should be announced via an aria-label on the parent, e.g. "Inbox, 12 unread messages".

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.