How to use the badge generator
- Choose a style: solid, soft, outline, status dot, gradient, with icon, removable chip, count or pill.
- Pick the tone you’re editing and type its text. The preview shows all six tones together.
- Set the size, corner radius, weight and whether text is uppercase.
- Adjust tone colors to match your brand. The contrast check covers every tone.
- Export HTML (all tones), CSS, SCSS, Tailwind or React.
How it’s built
The base .badge class defines the shape. Each tone modifier only sets three custom properties:
.badge--success { --badge-bg: #DCF0E3; --badge-fg: #0F5A2B; --badge-border: #DCF0E3; }
That keeps the CSS small and makes it easy to add new tones: copy a modifier and change three values.
Worked examples
Example 1: order statuses
Load Soft and use tones for statuses: success for “Delivered”, warning for “Pending”, danger for “Cancelled” and neutral for “Draft”. The text labels carry the meaning; the colors help people scan.
Example 2: online presence
Load Dot for user presence: a small dot in the tone color before “Online”, “Away” or “Busy”. It’s compact enough for lists and tables.
Example 3: filter chips
Load Chip brand for active filters above search results. Each chip has a labelled remove button, so keyboard and screen-reader users can clear filters one by one.
Tips
- Use a limited set of tones, and use them consistently across the product.
- Uppercase badges need slightly increased letter spacing (the export adds 0.04em).
- Keep badge text to one or two words.
- Gradient badges look premium but use white text, so check that both ends of the gradient pass.
Common mistakes
- Too many tones. If every badge is a different color, none of them stands out. Reserve red and amber for things that need attention.
- Badges that look like buttons. Badges are labels. If something is clickable, style it as a button or link and give it a focus state.
- Pale text on pale backgrounds. Soft badges often fail contrast when the text is just the tone color. The generator darkens it until it passes; keep that if you edit the CSS by hand.
- Long text. Badges are for one or two words. Longer messages belong in an alert or a note.