Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Tones

Keep one tone per state, so a status reads the same wherever it appears.

The lifecycle tones
Active Pending Failed Draft Archived
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 draws a hyphen, the placeholder for an empty table cell.

No label shows a hyphen
-
Show code
<app-status-badge />

Long labels

A long label grows the pill rather than truncating, so keep it to a word or two.

Long label stays whole
Payment failed, retry scheduled for tomorrow
Show code
<app-status-badge label="Payment failed, retry scheduled for tomorrow" tone="Danger" />

Extra classes

Add a class for analytics or layout; it is appended after the tone class, never replacing it.

Extra class on a pill
Active
Show code
<app-status-badge label="Active" tone="Success" class="analytics-pill" />

Every option

Every value of every prop, one cell each.

tone: every semantic value

tone="success"
Status
tone="warning"
Status
tone="danger"
Status
tone="info"
Status
tone="primary"
Status
tone="neutral" (default)
Status

label

(omitted) → hyphen
-
label={null}: React only, Razor omits the attribute
-
label="" → hyphen
-
inner content: Razor has no ReactNode label, but child markup composes the same way
Live
long label: no truncation, the pill grows
Payment failed, retry scheduled for tomorrow

status: one value from a map

status="Monday"
Working
status="Tuesday"
Working
status="Wednesday"
Working
status="Thursday"
Working
status="Friday"
Half day
status="Saturday"
Weekend
status="Sunday"
Weekend

bordered: off and on

(omitted) (default)
Urgent
bordered="true"
Urgent

className or class: appended, not replaced

class="analytics-pill"
Active

tooltip: text

tooltip="Shown on hover and focus"
Active

tooltip placement: all five

tooltip-placement="auto" (default)
Active
tooltip-placement="top"
Active
tooltip-placement="bottom"
Active
tooltip-placement="start"
Active
tooltip-placement="end"
Active

other attributes: passed to the span

data-status="active": any other attribute reaches the span
Active

Guidance

What to do, and what to avoid.

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 or tag). → AppChip
  • The user is picking one option from a set. → AppChoiceChip
  • It is a persistent inline message. → AppAlert

One consistent tone per status

Do
Active Pending Failed

Each status maps to a consistent, meaningful tone: the colour reinforces the word.

Avoid
Active Pending Failed

One tone for every status throws away the signal: the colour tells the user nothing.

Pill holds one or two words

Do
Failed

A single, concise status word, instantly scannable.

Avoid
Payment failed, retry scheduled for tomorrow

A pill is not a place for a sentence: keep the status to a word or two and explain elsewhere.

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

success warning danger info primary neutral
(use label and tone) Monday Friday Sunday
(auto) top bottom start end
Active
React, generated from the controls
<AppStatusBadge label="Active" />
Razor, the same props
<app-status-badge label="Active" />

7 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
labeldefault - string - The status text. Omit (or pass empty) to render a hyphen.
tonedefault neutral string neutral The tone class suffix: neutral, primary, success, warning, danger or info.
tooltipdefault - string - A hover and focus tooltip that flips to stay on screen. Use it to spell out a terse status.
tooltip-placementdefault auto auto | top | bottom | start | end auto The preferred tooltip side. Auto picks the side with the most room.
bordereddefault false bool false Draws a 1px border in the tone's own colour, so the pill stands off a white row.

Less common 2 props

PropTypeDefaultDescription
statusdefault - StatusDisplay - Label and tone as one value, usually from a StatusDisplayMap. Never set with label or tone.
classdefault - string - Not a bound tag-helper property: an ordinary HTML class attribute on <app-status-badge> is preserved and appended after the tone class.

Screen reader

3 notes
  • The status is real text in a span, so the word carries the meaning and the colour only reinforces it.
  • With no label the badge draws a plain hyphen instead of an empty pill.
  • A tooltip, when set, opens on hover and on keyboard focus and flips to stay on screen.

Do and avoid

2 pairs

One consistent tone per status

Do
Active Pending Failed

Each status maps to a consistent, meaningful tone: the colour reinforces the word.

Avoid
Active Pending Failed

One tone for every status throws away the signal: the colour tells the user nothing.

Pill holds one or two words

Do
Failed

A single, concise status word, instantly scannable.

Avoid
Payment failed, retry scheduled for tomorrow

A pill is not a place for a sentence: keep the status to a word or two and explain elsewhere.