AppStatusBadge
A status pill mapped from a record’s state — Active, Pending, Failed — in a consistent tone.
<app-status-badge label="Active" tone="success" />A status badge is a small pill that shows where a record stands — Active, Pending, Failed, Draft. It's the pill in a table's status column and beside a record's title, giving the state a consistent colour so a user reads a whole list at a glance.
The library owns only the look; your app maps its own status enum to a label and a tone. Its look comes entirely from the shared @webority/theme, so the Razor <app-status-badge> and the React <AppStatusBadge> render identically on every Webority surface.
Playground
Every attribute, live. Each change re-renders the real tag helper on the server, so the markup underneath is the exact call that produced the badge above it.
Tones
Five tones cover the common lifecycle states — green for healthy/active, amber for pending or in-progress, red for failed or blocked, blue for informational, grey for neutral or inactive.
Show code
<app-status-badge label="Active" tone="success" /> <app-status-badge label="Pending" tone="warning" /> <app-status-badge label="Failed" tone="danger" /> <app-status-badge label="Draft" tone="info" /> <app-status-badge label="Archived" tone="neutral" />
Empty state
With no label the badge renders an em-dash — the tidy “nothing to show” placeholder for an empty table cell.
Show code
<app-status-badge />
When to use
Use it when
- You are showing where a record stands — a lifecycle or workflow status.
- A table has a status column that should read consistently down the list.
- You are mapping a status enum to a coloured pill.
Reach for something else when
- You are showing a count or a short static label. → AppBadge
- The token should be removable (a filter/tag). → AppChip
- The user is picking one option from a set. → AppChoiceChip
- It is a persistent inline message. → AppAlert
Best practices
Every option
The whole surface of the component, one cell per value — every semantic tone and every label edge case.
tone — every semantic value
tone="success"
tone="warning"
tone="danger"
tone="info"
tone="primary"
tone="neutral"
label
(omitted) → em-dashlabel="" → em-dashinner content — Razor has no ReactNode label, but child markup composes the same way
long label — no truncation, the pill growsclass — appended, not replaced
class="analytics-pill"Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| label | string | — | The status text. Omit (or pass empty) to render an em-dash. |
| tone | string | neutral | Semantic tone — success | warning | danger | info | primary | neutral. Same vocabulary as the React component. |
| class | string | — | Not a bound tag-helper property — an ordinary HTML class attribute on <app-status-badge> is preserved and appended after the tone class, the same behaviour as the React className prop. |
| tooltip | string | — | A collision-aware hover/focus tooltip (Bootstrap/Popper, same engine as <app-tooltip>) that flips to stay on-screen — useful to spell out a terse status pill's full meaning. |
| tooltip-placement | string | auto | auto | top | bottom | start | end — preferred tooltip side; auto picks the side with the most room. |