On this page
@addTagHelper *, Webority.Ui.RazorBasic
Pass the value already formatted, using the shared format helpers so grouping and currency match the product.
Deltas
Pick the direction or let it read from the sign, and colour the delta where a rise is bad news.
A row of tiles
Put up to four tiles in one row on a dashboard, since a narrower tile cannot fit its value.
Icon placement
Set the icon inline when the figure reads better beside its label than above it.
Surfaces
Pick the surface for where the tile sits: plain on a bare page, filled or accent inside a card.
Spotlight
A feature tile with the icon top right, a large value and its caption below, for one headline figure.
Custom styling per part
Style the label, value and icon chip through per-part class props, without overriding the component's CSS.
Every option
Every value of every prop, one cell each.
label
label="Open projects"value
value="128"caption
caption="Total sent"icon
icon="folder-kanban"icon={node}: React only, Razor takes a nameicon-tone: all six
icon-tone="primary"icon-tone="success"icon-tone="warning"icon-tone="danger"icon-tone="info"icon-tone="neutral"icon-variant: all six iconsax styles
icon-variant="linear"icon-variant="outline"icon-variant="bold"icon-variant="bulk"icon-variant="broken"icon-variant="twotone" (default)delta
delta="12% vs last month"delta-direction: explicit and inferred
delta-direction="up"delta-direction="down"delta-direction="flat"delta="+12%": inferred up, no delta-directiondelta-tone: the colour the news deserves
delta-tone="danger"delta-tone="success"delta-tone="neutral"sparkline: data shapes
sparkline="12,15,14,19,22,18"sparkline="7": single point, flat midlinevariant: all four
variant="plain" (default)variant="filled"variant="accent"variant="spotlight"size: sm / md / lg
size="sm"size="md" (default)size="lg"value-size: custom px for the value (tames a large headline)
spotlight default (36px)value-size="30"value-size="64" (plain)inline
inline="false" (default)inline="true"attention
attention="false" (default)attention="true"href: the whole tile as a link
href="/Components/AppKpiTile": renders a linkhref + attention + deltavalue / delta as nodes: non-string ReactNode
value={node}: React only, Razor takes a stringdelta={node}: React only, Razor takes a stringcurrent and previous: computed delta
current="128" previous="96"current="128" previous="0": no delta showncurrent-minor and previous-minor: paise
current-minor="15000000" previous-minor="12000000"format
format="number" (default)format="percent"period-label
period-label="vs last quarter"linkComponent
linkComponent: React only, a router Link for an in-app hrefclass
class: extra classes on the tile rooticon-class
icon-class: extra classes on the icon chiplabel-class
label-class: extra classes on the labelvalue-class
value-class: extra classes on the valuecaption-class
caption-class: extra classes on the captiondelta-class
delta-class: extra classes on the deltasparkline-class
sparkline-class: extra classes on the sparklineGuidance
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
Name what is measured and say what the delta compares against. “vs last week” is what makes 12 meaningful.
“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.
29 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| 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
| Prop | Type | Default | Description |
|---|---|---|---|
| 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 pairsName the measure and comparison
Name what is measured and say what the delta compares against. “vs last week” is what makes 12 meaningful.
“Count” of what? “+4” since when? The reader cannot act on either without going to look somewhere else.