Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Basic

Pass the value already formatted, using the shared format helpers so grouping and currency match the product.

Label and value
Open projects
128
Billed this month
₹4,82,000
Show code
<app-kpi-tile label="Open projects" value="128" />
<app-kpi-tile label="Billed this month" value="₹4,82,000" />

Deltas

Pick the direction or let it read from the sign, and colour the delta where a rise is bad news.

Up, down, and flat
Open projects
128
12% vs last month
Overdue
7
3 fewer than last week
Awaiting sign-off
12
unchanged
Show code
<app-kpi-tile label="Open projects" value="128" delta="12% vs last month" delta-direction="AppKpiTileDeltaDirection.Up" />
<app-kpi-tile label="Overdue" value="7" delta="3 fewer than last week" delta-direction="AppKpiTileDeltaDirection.Down" />
<app-kpi-tile label="Awaiting sign-off" value="12" delta="unchanged" />

A row of tiles

Put up to four tiles in one row on a dashboard, since a narrower tile cannot fit its value.

The dashboard strip
Open projects
128
Sites
1,204
Reports issued
86
Awaiting sign-off
12
Show code
<div class="kpi-row">
    <app-kpi-tile label="Open projects" value="128" icon="folder-kanban" />
    <app-kpi-tile label="Sites" value="1,204" icon="building-2" />
    <app-kpi-tile label="Reports issued" value="86" icon="file-text" />
    <app-kpi-tile label="Awaiting sign-off" value="12" icon="clipboard-check" />
</div>

Icon placement

Set the icon inline when the figure reads better beside its label than above it.

Icon beside the label
Open projects
128
Sites
1,204
Show code
<app-kpi-tile inline="true" label="Open projects" value="128" icon="folder-kanban" />

Surfaces

Pick the surface for where the tile sits: plain on a bare page, filled or accent inside a card.

Plain, filled and accent
Open projects
128
Sites
1,204
Reports issued
86
Show code
<app-kpi-tile label="Open projects" value="128" icon="folder-kanban" />
<app-kpi-tile label="Sites" value="1,204" icon="building-2" variant="Filled" />
<app-kpi-tile label="Reports issued" value="86" icon="file-text" variant="Accent" />

Spotlight

A feature tile with the icon top right, a large value and its caption below, for one headline figure.

Label top-left, icon top-right, caption below
Referrals
9
Total sent
Active members
1,204
Across all workspaces
Show code
<app-kpi-tile variant="Spotlight" label="Referrals" value="9" caption="Total sent" icon="users" />
Brand figure face
Referrals
9
Total sent
Show code
<app-kpi-tile variant="Spotlight" label="Referrals" value="9" caption="Total sent" icon="users" class="sc-brand-figure" />

Custom styling per part

Style the label, value and icon chip through per-part class props, without overriding the component's CSS.

A class on each slot
Revenue
₹1,50,000
Show code
<app-kpi-tile label="Revenue" value="₹1,50,000" icon="cash-stack"
              label-class="kpi-demo-label" value-class="kpi-demo-value" icon-class="kpi-demo-icon" />

Every option

Every value of every prop, one cell each.

label

label="Open projects"
Open projects
128

value

value="128"
Open projects
128

caption

caption="Total sent"
Referrals
9
Total sent

icon

icon="folder-kanban"
Open projects
128
icon={node}: React only, Razor takes a name
Open projects
128

icon-tone: all six

icon-tone="primary"
Open projects
128
icon-tone="success"
Open projects
128
icon-tone="warning"
Open projects
128
icon-tone="danger"
Open projects
128
icon-tone="info"
Open projects
128
icon-tone="neutral"
Open projects
128

icon-variant: all six iconsax styles

icon-variant="linear"
Members
1,204
icon-variant="outline"
Members
1,204
icon-variant="bold"
Members
1,204
icon-variant="bulk"
Members
1,204
icon-variant="broken"
Members
1,204
icon-variant="twotone" (default)
Members
1,204

delta

delta="12% vs last month"
Open projects
128
12% vs last month

delta-direction: explicit and inferred

delta-direction="up"
Open projects
128
12%
delta-direction="down"
Overdue
7
3 fewer
delta-direction="flat"
Awaiting sign-off
12
unchanged
delta="+12%": inferred up, no delta-direction
Open projects
128
+12%

delta-tone: the colour the news deserves

delta-tone="danger"
Refunds
38
14 more than last month
delta-tone="success"
Overdue
7
3 fewer than last week
delta-tone="neutral"
Sites
1,204
12 new this month

sparkline: data shapes

sparkline="12,15,14,19,22,18"
Revenue
₹1,50,000
sparkline="7": single point, flat midline
Revenue
₹1,50,000

variant: all four

variant="plain" (default)
Open projects
128
variant="filled"
Open projects
128
variant="accent"
Open projects
128
variant="spotlight"
Referrals
9
Total sent

size: sm / md / lg

size="sm"
Open projects
128
size="md" (default)
Open projects
128
size="lg"
Open projects
128

value-size: custom px for the value (tames a large headline)

spotlight default (36px)
Active members
1,204
Across all workspaces
value-size="30"
Active members
1,204
Across all workspaces
value-size="64" (plain)
Open projects
128

inline

inline="false" (default)
Open projects
128
inline="true"
Open projects
128

attention

attention="false" (default)
Overdue
7
attention="true"
Overdue
7

href: the whole tile as a link

href="/Components/AppKpiTile": renders a link
href + attention + delta

value / delta as nodes: non-string ReactNode

value={node}: React only, Razor takes a string
Open projects
128
delta={node}: React only, Razor takes a string
Open projects
128
steady all week

current and previous: computed delta

current="128" previous="96"
Open projects
128
+33% vs last period
current="128" previous="0": no delta shown
Open projects
128

current-minor and previous-minor: paise

current-minor="15000000" previous-minor="12000000"
Revenue
₹1,50,000
+25% vs last period

format

format="number" (default)
Open projects
128
format="percent"
Margin
42.5%

period-label

period-label="vs last quarter"
Open projects
128
+33% vs last quarter

linkComponent

linkComponent: React only, a router Link for an in-app href

class

class: extra classes on the tile root
Open projects
128

icon-class

icon-class: extra classes on the icon chip
Open projects
128

label-class

label-class: extra classes on the label
Open projects
128

value-class

value-class: extra classes on the value
Open projects
128

caption-class

caption-class: extra classes on the caption
Referrals
9
Total sent

delta-class

delta-class: extra classes on the delta
Open projects
128
12% vs last month

sparkline-class

sparkline-class: extra classes on the sparkline
Revenue
₹1,50,000

Guidance

What to do, and what to avoid.

Use it when

  • A single derived number is worth stating on its own: a total, a count, a rate.
  • The reader should see it without reading a table.
  • You are building a dashboard strip or a summary above a list.

Reach for something else when

  • You are showing many records with fields. → AppDataTable
  • The value is a status rather than a quantity. → AppStatusBadge
  • It is a label/value pair among several facts. → AppDescriptions
  • The number needs a chart to make sense. → a chart

Name the measure and comparison

Do
Awaiting sign-off
12
4 more than last week

Name what is measured and say what the delta compares against. “vs last week” is what makes 12 meaningful.

Avoid
Count
12
+4

“Count” of what? “+4” since when? The reader cannot act on either without going to look somewhere else.

Reference

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

(none) ₹1,50,000.00 ₹82,400.50
(none) ₹1,20,000.00 ₹1,65,000.00
number percent
(none) folder-kanban trending-up building-2 clipboard-check
(none) primary success warning danger info neutral
(default) linear outline bold bulk broken twotone
(inferred) up down flat
(from direction) success danger neutral
plain filled accent spotlight
sm md lg
Open projects
128
12% vs last month
React, generated from the controls
<AppKpiTile label="Open projects" value="128" delta="12% vs last month" size="sm" />
Razor, the same props
<app-kpi-tile label="Open projects" value="128" delta="12% vs last month" size="Sm" />

29 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
labeldefault - string - What the number measures. (required)
valuedefault - string - The number, already formatted for the locale. (required)
captiondefault - string - A sub-line under the value (e.g. “Total sent”). Reads best with the spotlight variant.
deltadefault - string - Change text. Say what it compares against.
delta-directiondefault flat up | down | flat flat Colours the delta and picks its arrow. Left out, it is read from a leading plus or minus sign on the delta and falls back to flat.

Less common 24 props

PropTypeDefaultDescription
icondefault - string - An icon name for the leading tile, or a custom node.
icon-tonedefault - primary | success | warning | danger | info | neutral - Tints the icon chip.
icon-variantdefault linear linear | outline | bold | bulk | broken | twotone linear The icon style of a named icon; a node icon is drawn as given.
currentdefault - double - The figure as a number, instead of a formatted value: the tile formats it with format and, with previous, works out the change. Never set with value or delta.
previousdefault - double - The same figure for the last period. With current it gives the delta as a whole percent change; zero or empty shows no delta. Needs current.
current-minordefault - MinorUnits - An amount in paise, shown as rupees with Indian grouping. With previous-minor it works out the change. Never set with current, value, delta or format.
previous-minordefault - MinorUnits - The same amount for the last period. Needs current-minor.
formatdefault number number | percent number How current is shown. percent takes the percent itself (42.5 shows "42.5%"). An unknown value throws.
period-labeldefault vs last period string vs last period The words after a computed delta. Used with current and previous.
delta-tonedefault - success | danger | neutral - The delta's colour, overriding the one its direction implies, for a figure where a rise is bad news such as refunds or cost. The arrow still follows the direction.
sparklinedefault - string - Comma-separated trend series, e.g. "12,15,14,19". It is rendered as a small inline chart.
variantdefault plain plain | filled | accent | spotlight plain The tile surface and layout: plain is a borderless tile, filled a subtle fill, accent a brand-tinted fill, spotlight a feature tile with the icon top right, a large value and the caption below.
sizedefault md sm | md | lg md The tile scale: sm is compact, md the default, lg a hero tile with an enlarged value.
value-sizedefault - int (px) - A custom value font size in px. It overrides the size and variant default, to tame a too-large headline.
inlinedefault false bool false Puts the icon beside the text instead of above it.
attentiondefault false bool false Marks the tile as needing action, with a warning tint.
hrefdefault - string - Renders the whole tile as a link to this address.
classdefault - string - Extra classes on the tile.
icon-classdefault - string - Extra classes on the icon chip.
label-classdefault - string - Extra classes on the label.
value-classdefault - string - Extra classes on the value.
caption-classdefault - string - Extra classes on the caption.
delta-classdefault - string - Extra classes on the delta.
sparkline-classdefault - string - Extra classes on the sparkline.

Screen reader

2 notes
  • The delta arrow carries the direction as well as the colour, so a reader who cannot tell green from red still gets it.
  • With href the whole tile is one link, a router link when a link component is given; without href it is a plain block, never a link with no target.

Do and avoid

1 pairs

Name the measure and comparison

Do
Awaiting sign-off
12
4 more than last week

Name what is measured and say what the delta compares against. “vs last week” is what makes 12 meaningful.

Avoid
Count
12
+4

“Count” of what? “+4” since when? The reader cannot act on either without going to look somewhere else.