Tucano v0.37.2

Badge

The status of a record: approved, under review, overdue, draft. It was born for the "status" column of a table, which is where it always shows up, but it doesn't depend on it: it works in a card, in a list and next to a heading. Classes only.

Approved Under review Overdue New Draft No dot

Examples

The tone carries the meaning; the weight stays with the text of the row.

In a table

The status column, read at a glance in a long list.

ContractStatus
Corner BakeryPaid
Two Wheels GarageUnder review
Wellness ClinicOverdue
Aurora StudioDraft

No dot

is-plain, for what isn't a status: version, count, category.

v2.4 12 attachments Services Beta

With an icon

The icon takes the place of the dot: use it with is-plain. With stroke="currentColor" it picks up the tone color on its own, and aria-hidden="true" lets screen readers read only the text.

Released Beta Paid Pending Urgent

How to use

<span class="tuc-badge is-success">Approved</span>
<span class="tuc-badge is-warning">Under review</span>
<span class="tuc-badge is-danger">Overdue</span>
<span class="tuc-badge is-info">New</span>
<span class="tuc-badge">Draft</span>
<span class="tuc-badge is-plain">12 attachments</span>

In Django

The tone is a decision of the model, not of the template: that way it is the same in the list, in the detail page and in the email.

class Contract(models.Model):
    status = models.CharField(max_length=20, choices=Status.choices)

    @property
    def status_tone(self):
        return {"paid": "success", "review": "warning", "overdue": "danger"}.get(self.status, "")
<span class="tuc-badge {% if contract.status_tone %}is-{{ contract.status_tone }}{% endif %}">
  {{ contract.get_status_display }}
</span>

Why not filled

Soft background with strong text. In a list of twenty rows, twenty solid badges compete with the content and the table turns into a traffic light.

The dot repeats the status without relying on background color alone — together with the text, it helps people who can't tell the colors apart, and it reads better on a small screen. It is a pseudo-element, so the screen reader reads only the text, and it is the text that has to state the status: "Overdue", not an empty red badge.

The color is the same as the toast and the alert

The tones read --tuc-success, --tuc-warning, --tuc-danger, --tuc-info and their -soft versions, and never --tuc-accent. The brand can be any color; the meaning of "overdue" can't change along with it.

Classes

ClassWhat for
.tuc-badgeThe badge. With no tone, neutral, with a border
is-successIt worked: approved, paid, active
is-warningNeeds attention: under review, pending
is-dangerIt went wrong: overdue, declined, blocked
is-infoInformation: new, scheduled
is-plainRemoves the dot