VERIFICATION-0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
Confirmed Needs attention Unknown BlockedStatus lozenge
<forma-status-lozenge>
Compact textual state label with a shape glyph and border, so state never depends on color.
- Authoring tag
<forma-status-lozenge>- Category
- Feedback and status
- Behavior owner
- Application state
- Canonical source
patterns/status-lozenge.html
Purpose
A status lozenge is a short, bordered label that names the state of something: Confirmed, Needs attention, Unknown, Blocked. Forma renders the text in a compact monospace box and adds a glyph before it from data-state (check, exclamation, question mark, cross, or a bullet when no state is set). The application chooses the wording and the data-state value; the text is the authority and the glyph is a redundant structural cue. A lozenge set lays several out in a wrapping row.
Use when
- A record, row or card needs a one- to three-word state label.
- Several independent states are shown together and should stay distinguishable in grayscale.
- A larger feedback pattern (Operation status, Conflict review, Readiness checklist) needs a state marker in its header.
Avoid when
- The label is a count or a category tag rather than a state: use Badge.
- The state needs an explanation or action: use Operation status or Alert, which can include a lozenge.
- The label is long or a sentence: lozenges do not wrap by default.
Behavior to know
- Five glyph shapes: ✓ for ok, ! for attention, ? for unknown, × for blocked, and • when
data-stateis absent or unrecognized. - All lozenges share one border, surface and text color; the difference is in words and glyph, not hue.
- Text does not wrap (
white-space: nowrap), so keep labels short.
Basic example
The smallest correct markup: the canonical pattern from patterns/status-lozenge.html inside its public tag. Copy this first, then adapt labels, names and state.
Minimal status lozenge
Rendered from the canonical pattern file.
<forma-status-lozenge class="forma-component-tag">
<div class="forma-status-lozenge-set" aria-label="Status examples">
<span class="forma-status-lozenge" data-state="ok">Confirmed</span>
<span class="forma-status-lozenge" data-state="attention">Needs attention</span>
<span class="forma-status-lozenge" data-state="unknown">Unknown</span>
<span class="forma-status-lozenge" data-state="blocked">Blocked</span>
</div>
</forma-status-lozenge>
Click or tap the code once to select all of it, then copy.
Examples
Deployment environments
Lozenges inside a Key-value list describing three environments. Each state is named in words; the glyphs repeat the distinction in shape.
- Production
- Healthy
- Staging
- Deploy pending approval
- Disaster recovery
- Not reporting
<forma-status-lozenge class="forma-component-tag">
<dl class="forma-key-value-list">
<div><dt>Production</dt><dd><span class="forma-status-lozenge" data-state="ok">Healthy</span></dd></div>
<div><dt>Staging</dt><dd><span class="forma-status-lozenge" data-state="attention">Deploy pending approval</span></dd></div>
<div><dt>Disaster recovery</dt><dd><span class="forma-status-lozenge" data-state="unknown">Not reporting</span></dd></div>
</dl>
</forma-status-lozenge>
Click or tap the code once to select all of it, then copy.
Neutral workflow states
States that are neither good nor bad, such as Draft or Scheduled, omit data-state and get the neutral bullet. The set is a labelled group so its purpose is announced.
<forma-status-lozenge class="forma-component-tag">
<div class="forma-status-lozenge-set" role="group" aria-label="Invoice workflow states">
<span class="forma-status-lozenge">Draft</span>
<span class="forma-status-lozenge">Scheduled</span>
<span class="forma-status-lozenge" data-state="ok">Paid</span>
<span class="forma-status-lozenge" data-state="blocked">Voided</span>
</div>
</forma-status-lozenge>
Click or tap the code once to select all of it, then copy.
Mobile
Each mobile example renders in its own document inside a real narrow viewport, so Forma's media and container queries run exactly as they would on a phone. Choose a width to compare.
Mobile status set
A lozenge set at phone width.
What changes at narrow widths
- Below 30rem each lozenge in a set takes the full row and its content is centered, so the set becomes a vertical list.
- Lozenge text does not wrap; a very long label can overflow a narrow screen, so keep labels to a few words.
- Lozenges are not interactive and have no touch target; if a state needs an action, place a button next to it.
- Orientation changes let the set return to a wrapping row once the width exceeds 30rem.
<forma-status-lozenge class="forma-component-tag">
<div class="forma-status-lozenge-set" role="group" aria-label="Payment run status">
<span class="forma-status-lozenge" data-state="ok">112 sent</span>
<span class="forma-status-lozenge" data-state="attention">6 held</span>
<span class="forma-status-lozenge" data-state="unknown">2 unconfirmed</span>
<span class="forma-status-lozenge" data-state="blocked">1 rejected</span>
</div>
</forma-status-lozenge>
Click or tap the code once to select all of it, then copy.
Mobile · 320px
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
API and configuration
Forma components have no JavaScript API. Their public contract is the markup: native elements and attributes you write, and the CSS hooks below. The CSS hook table is generated from the built stylesheet, so it always matches the shipped implementation.
| Attribute | On | Values | Default | Description |
|---|---|---|---|---|
data-state | span.forma-status-lozenge | ok | attention | unknown | blocked | absent (neutral bullet) | Selects the leading glyph. Presentation only; the text must name the state. |
role | div.forma-status-lozenge-set | group | — | Optional. Lets a set carry an accessible name when its purpose is not clear from surrounding headings. |
aria-label | div.forma-status-lozenge-set | string | — | Names the set. Use it together with a role such as group; a label on a plain div is ignored by many screen readers. |
| Hook | Kind | Values or default | Description |
|---|---|---|---|
.forma-status-lozenge | Block class | — | Inline-flex bordered label with monospace 0.6875rem text, a 1.75rem minimum height and a generated leading glyph. |
[data-state] | Attribute hook | "attention", "blocked", "ok", "unknown" | Chooses the glyph: ok ✓, attention !, unknown ?, blocked ×. Any other value or none shows •. |
.forma-status-lozenge-set | Block class | — | Wrapping flex row for several lozenges. Below 30rem each lozenge takes the full row. |
| Keys | Result |
|---|---|
| — | Not focusable or interactive. |
| Event | Description |
|---|---|
— | None. |
Form behavior
Not a form control.
States
| State | How it is expressed | Presentation |
|---|---|---|
| Ok | data-state="ok" | Check-mark glyph. Use for confirmed, healthy, complete. |
| Attention | data-state="attention" | Exclamation glyph. Use for pending, stale, partial, needs review. |
| Unknown | data-state="unknown" | Question-mark glyph. Use when the state has not been established; unknown is not failure. |
| Blocked | data-state="blocked" | Cross glyph. Use for blocked, rejected, unavailable. |
| Neutral | no data-state | Bullet glyph for states with no attention implication. |
Accessibility
Forma provides
- Uses a border, glyph shape and text rather than color to distinguish states.
- Draws the lozenge in the standard text and border tokens, which Forma maps to system colors in forced colors.
Your application supplies
- Write the full state in text; do not rely on the glyph. The glyph is CSS generated content and some screen readers announce it along with the text.
- Do not repeat the glyph character in the text.
- Give a set an accessible name only with a role that supports one (for example
role="group").
Responsive behavior
- Lozenges size to their text and never wrap internally.
- A set is a wrapping flex row; below 30rem its lozenges become full-width rows with centered content.
- Inside Attention path and Emphasis budget Forma allows lozenge text to wrap at narrow widths; elsewhere keep labels short.
Motion
- No animation: a lozenge changes when the application changes its text or
data-state.
Usage guidance
Do
- Use consistent vocabulary across the product ("Unknown" always means the state has not been established).
- Map domain states to
data-statedeliberately and document the mapping in the application.
Avoid
- Encoding state only through
data-statewith generic text such as "Status". - Using attention or blocked glyphs for states that are merely neutral.
Verification specimens
Generated fault-injection specimens expose content, spacing, color-cue, and reduced-effective-contrast risks. They screen presentation robustness as engineering screens without claiming human-subject validation.