Badge
The status capsule from exact:content, used once: the state of an agent run on its run card.

Badge shows a state as a word in a small capsule, so a status reads as text and never as a colour alone. It is a platform part: the app imports it from exact:content (agents.contract L3) and its source is in the Exact framework (content.contract L224-L249).

Two run cards in a conversation. Their badges read "Done" and "Canceled", white on the brand fill, at the trailing edge of each card's title row.

Used by

One call in the whole app:

Badge(label=run.label, tint=some(run.status == "failed" ? "danger.fill" : "brand.fill"))

It sits in the title row of AgentRunCard (agents.contract L439), which appears in the transcript of the Agent session. No other screen uses Badge.

Props

Prop

Type

Effect

In this app

label

string

The word in the capsule

The run's label from the server, for example "Done" or "Canceled"

tint

optional string

The fill. None gives a neutral grey capsule with label-coloured ink

Always set: danger.fill when the run's status is "failed", otherwise brand.fill

Anatomy

Read from the framework source:

    A capsule: border-radius=999, padding 2 points above and below, 8 points at the sides.

    The label in -exact-caption1 at weight 600, on one line (white-space="nowrap").

    On a custom fill such as the two tokens used here, the ink is the label colour of the dark scheme, which is white, in both light and dark mode.

    It never shrinks (flex-shrink=0). The title beside it gives way and wraps instead; the run card's title has flex=1, flex-basis="10rem" and min-width=0, and the row wraps at large text sizes so the badge can drop under the title.

The two fills

Token

Light

Dark

Meaning here

brand.fill

#007a70

#147a71

Every state except failed (the screenshot shows "Done" and "Canceled")

danger.fill

#b42318

#c4281c

Failed

Both are defined in app.tamber with pair=ink.on-brand, and its comment states the requirement: at least 4.5:1 under white text in both schemes. See Color and tokens and Light and dark. brand.fill is the same surface colour as the person's own chat bubble (Chat messages).

States

Badge has no state of its own. The word carries the state; the colour only separates failed from everything else. Canceled is not red: it is something the person chose.

Rules for use

    Use a Badge for a status that is one or two words and belongs to a card or row title. The Exact guidance is "A status is a Badge".

    Say the state in the label. Do not rely on the fill to carry meaning (Accessibility).

    Pass a token for the tint, never a hex value. A new tint needs a token in app.tamber with a contrast pair.

    Do not use it as a button, a counter or a tag list. Counts in this app are plain text: see CommentCount and the unread line of the Activity inbox.

    Keep red for failure. One red badge in a transcript should mean something went wrong.

Why it looks this way

DESIGN.md specifies "run cards as a secondary card with status badge (Badge)" and adds the two fill tokens for exactly this purpose: "brand.fill ... (my chat bubbles, status badges)" and "danger.fill ... a failed badge under white text". The darker dark-mode teal of brand.fill exists because the lighter brand tint (#26a596) does not reach 4.5:1 under white caption text. The shape and type are the framework's, modelled on how UIKit draws a filled badge (Leave it unsaid).

User stories

This page helps deliver these stories. Each story lists this page in its Trace, so the link holds in both directions (traceability).

Related

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime