Community project. This is not an official government website.

Run by volunteers. Lampung Design System is built by an open source community. No government agency runs or endorses it.

Official services use go.id. Government websites in Indonesia end in .go.id. Never enter your national ID number on a site you are unsure of.

Badge

Badge

A small, non-interactive label for the state or type of a thing: Draft, Overdue, Approved. Human words, one or two at most per item.

Usage

Use it when

  • Showing the state of a record in a row, a card or a table cell: Draft, In review, Approved, Overdue.
  • Marking a type or category that helps scanning: Seminar, Free, New.
  • A short time-bound flag: "Due tomorrow", "Ends today".

Use something else when

  • A number of unread or pending items: use Count.
  • The live health of a system or a connection, with a dot: use Status dot.
  • The person can press it to filter or choose: use Chips.
  • Removable tags the person typed: use Tag input.
  • A person is online: use Avatar. Use .avatar__presence.
  • A sentence of explanation: use Alert.

Where it goes. Next to the title it describes (after it in a row, above it in a card), or in its own table column. On phones it stays on one line; if a row has no room, move the badge under the title.

Examples

Tones for statesNeutral for draft, accent for in progress, success, warning, danger. The words carry the meaning.
Draft In review Approved Due tomorrow Overdue Seminar New
<div class="docs-row">
  <span class="badge">Draft</span>
  <span class="badge badge--accent">In review</span>
  <span class="badge badge--success"><span class="ic" aria-hidden="true">check</span>Approved</span>
  <span class="badge badge--warning">Due tomorrow</span>
  <span class="badge badge--danger">Overdue</span>
  <span class="badge badge--outline">Seminar</span>
  <span class="badge badge--solid">New</span>
</div>
In a list rowThe badge sits at the end of the row, after the text.
Essay on climate policy
Submitted 12 Nov
In review
Lab report 4
Due 10 Nov
Overdue
Reading notes, week 8
Graded 8 Nov
Graded
<div class="list" style="max-width: 460px;">
  <div class="lrow"><div class="lrow__body"><div class="lrow__title">Essay on climate policy</div><div class="lrow__sub">Submitted 12 Nov</div></div><span class="badge badge--accent">In review</span></div>
  <div class="lrow"><div class="lrow__body"><div class="lrow__title">Lab report 4</div><div class="lrow__sub">Due 10 Nov</div></div><span class="badge badge--danger">Overdue</span></div>
  <div class="lrow"><div class="lrow__body"><div class="lrow__title">Reading notes, week 8</div><div class="lrow__sub">Graded 8 Nov</div></div><span class="badge badge--success">Graded</span></div>
</div>
On a cardAbove the title for a type, beside it for a state.
Workshop
Writing a strong cover letter
Thursday, 13:00 · Room B2
<div class="card" style="max-width: 320px;">
  <span class="badge badge--outline">Workshop</span>
  <div class="card__title" style="margin-top: 10px;">Writing a strong cover letter</div>
  <div class="card__sub">Thursday, 13:00 · Room B2</div>
</div>

Anatomy

PartWhat it is
.badgeRequired. 22 px tall, 6 px radius, 12 px medium text, neutral tint.
.badge--accent|success|warning|dangerTone tint and text.
.badge--solidAccent fill with white text: the one badge that must stand out (rare).
.badge--outlineTransparent with a hairline: a quiet type or category.
.icOptional 14 px leading icon.

Variants and sizes

Class or attributeWhen
badgeNeutral: draft, archived, not started.
badge--accentIn progress, in review, current.
badge--successDone, approved, paid, open (seats).
badge--warningNeeds attention soon: due tomorrow, expiring.
badge--dangerFailed, overdue, full, declined.
badge--outlineA quiet category or type.
badge--solidThe single badge that must stand out ("New" on one item).

Motion and microinteractions

  • None at rest. When a state changes in place, change the words with text morph and let the tint cross-fade; do not pop or pulse the badge.

Accessibility

  • A badge is text, read in place; make sure the row reads well ("Lab report 4, Overdue").
  • Never make it clickable. If it must open something, it is a chip or a button.
  • The tone must also be in the words; "Overdue" in red, not a red badge saying "4".

Do and don't

Do

  • Use the same word for the same state everywhere in the product.
  • Keep it to one or two words in sentence case.
  • Limit an item to one state badge (plus at most one type badge).

Don't

  • Put numbers in a badge; use a count.
  • Use badges as buttons or filters.
  • Invent new colors; map each state to one of the tones.