Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Basic

Each value takes a label and a value; the note is optional and sits under the number.

Three values with notes
The note carries the comparison or the next date, in a few words.
Sprint 5
18 of 41 done
6 days left
Open bugs
23
4 more than last week
Unassigned
2
in Sprint 5
Show code
<app-metric-strip columns="3">
    <app-metric label="Sprint 5" value="18 of 41 done" note="6 days left"></app-metric>
    <app-metric label="Open bugs" value="23" note="4 more than last week"></app-metric>
    <app-metric label="Unassigned" value="2" note="in Sprint 5"></app-metric>
</app-metric-strip>

Columns

Three to five values sit in a row; below 768px the strip shows two columns, whatever the count.

Columns of three to five
Open
41
6 due
Blocked
3
Done
18
Open
41
6 due
Blocked
3
Done
18
Net
+2
Open
41
6 due
Blocked
3
Done
18
Net
+2
Late
5
Show code
<app-metric-strip columns="3">
    <app-metric label="Open" value="41" note="6 due"></app-metric>
    <app-metric label="Blocked" value="3"></app-metric>
    <app-metric label="Done" value="18"></app-metric>
</app-metric-strip>
<app-metric-strip columns="4">
    <app-metric label="Open" value="41" note="6 due"></app-metric>
    <app-metric label="Blocked" value="3"></app-metric>
    <app-metric label="Done" value="18"></app-metric>
    <app-metric label="Net" value="+2"></app-metric>
</app-metric-strip>
<app-metric-strip columns="5">
    <app-metric label="Open" value="41" note="6 due"></app-metric>
    <app-metric label="Blocked" value="3"></app-metric>
    <app-metric label="Done" value="18"></app-metric>
    <app-metric label="Net" value="+2"></app-metric>
    <app-metric label="Late" value="5"></app-metric>
</app-metric-strip>

Size

Use sm under a dense page header; md is the default for a strip in the page body.

Small under a page header
Open
41
6 due this week
Blocked
3
Done
18
Show code
<app-page-header title="Sprint 5"></app-page-header>
<app-metric-strip columns="3" size="Sm">
    <app-metric label="Open" value="41" note="6 due this week" href="/Components/AppMetricStrip"></app-metric>
    <app-metric label="Blocked" value="3" tone="Danger"></app-metric>
    <app-metric label="Done" value="18"></app-metric>
</app-metric-strip>

Divided

Inside a flush card the figures form one row with a rule between them from md up. Below md they stay two to a row with no rules.

Figures in a flush card
Open
41
6 due
Blocked
3
Done
18
Show code
<app-card flush="true">
    <app-metric-strip columns="3" divided="true">
        <app-metric label="Open" value="41" note="6 due"></app-metric>
        <app-metric label="Blocked" value="3" tone="Danger"></app-metric>
        <app-metric label="Done" value="18"></app-metric>
    </app-metric-strip>
</app-card>

Tone

The tone tints the value only, so use it for a number that is good or bad news, not decoration.

Good and bad news
Open
41
Done
18
Late
5
Blocked
3
Watching
7
Show code
<app-metric-strip columns="5">
    <app-metric label="Open" value="41" tone="Neutral"></app-metric>
    <app-metric label="Done" value="18" tone="Success"></app-metric>
    <app-metric label="Late" value="5" tone="Warning"></app-metric>
    <app-metric label="Blocked" value="3" tone="Danger"></app-metric>
    <app-metric label="Watching" value="7" tone="Info"></app-metric>
</app-metric-strip>

Every option

Every value of every prop, one cell each.

columns: 3, 4, 5

columns="3"
Open
41
6 due
Blocked
3
Done
18
(default) columns="4"
Open
41
6 due
Blocked
3
Done
18
Net
+2
columns="5"
Open
41
6 due
Blocked
3
Done
18
Net
+2
Late
5

size: md, sm

(default) size="md"
Sprint 5
18 of 41 done
6 days left
Open bugs
23
Unassigned
2
size="sm"
Sprint 5
18 of 41 done
6 days left
Open bugs
23
Unassigned
2

tone: neutral, success, warning, danger, info

tone="neutral"
Blocked
3
this sprint
Done
18
Open
41
tone="success"
Blocked
3
this sprint
Done
18
Open
41
tone="warning"
Blocked
3
this sprint
Done
18
Open
41
tone="danger"
Blocked
3
this sprint
Done
18
Open
41
tone="info"
Blocked
3
this sprint
Done
18
Open
41

href: makes the value a link

href="/Components/AppMetricStrip"
Open
41
6 due
Blocked
3
Done
18

label, value and note: text

label="Sprint 5"
Sprint 5
18
Open bugs
23
Unassigned
2
value="18 of 41 done"
Sprint 5
18 of 41 done
Open bugs
23
Unassigned
2
note="6 days left"
Sprint 5
18
6 days left
Open bugs
23
Unassigned
2

items: the values

items={[{ label, value, note, href, tone }]} in React, app-metric children here
Open
41
6 due
Blocked
3
Done
18
Net
+2

linkComponent: React only

linkComponent: React only, Razor keeps the plain href
Open
41
Blocked
3
Done
18

className: React only

className: React only, Razor has no equivalent
Blocked
3
this sprint
Done
18
Open
41

Guidance

What to do, and what to avoid.

Use it when

  • A page opens with three to five headline numbers.
  • Each number links to the list or report behind it.
  • The numbers need no surface of their own.

Reach for something else when

  • One number needs its own card and icon. → AppKpiTile
  • The facts are a record's details. → AppDescriptions
  • You are listing many records. → AppDataTable

Reference

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

3 4 5
md sm
Open
41
6 due this week
Blocked
3
Done
18
React, generated from the controls
<AppMetricStrip items={items} />
Razor, the same props
<app-metric-strip>
    <app-metric label="Open" value="41" note="6 due this week" href="/sprint"></app-metric>
    <app-metric label="Blocked" value="3" tone="Danger"></app-metric>
    <app-metric label="Done" value="18"></app-metric>
</app-metric-strip>

8 props. The 3 most used come first.

Used on most screens 3 props

PropTypeDefaultDescription
columnsdefault 4 3 | 4 | 5 4 How many values sit in a row.
sizedefault md sm | md md The value and label scale.
divideddefault false bool false Draws the strip as one flush row with a rule between figures from md up, for a strip inside a flush card.

Less common 5 props

PropTypeDefaultDescription
labeldefault - string - The label above the value.
valuedefault - string - The value itself, already formatted.
notedefault - string - A short line under the value.
hrefdefault - string - Makes the value a link to this URL.
tonedefault neutral neutral | success | warning | danger | info neutral Tints the value.

Screen reader

2 notes
  • An item with an href is a real link; an item without one is plain text, so nothing is announced as a link that goes nowhere.
  • Label, value and note are plain text in reading order, with no hidden content.