Skip to content

Stat

Last updated 12 Nov 2026

NbStat is one figure with its name: a count, a total, a rate. It can say how the figure moved (an arrow and a delta), carry a status colour, and take the reader to the list the number counts.

A row of tiles ​

Lay tiles out with NbCardGrid, which wraps them by their own width, so a row of four becomes two rows of two on a phone without a breakpoint.

vue
<NbCardGrid min="150px">
  <NbStat label="Created" :value="result.created" status="success" />
  <NbStat label="Updated" :value="result.updated" status="warning" />
  <NbStat label="Skipped" :value="result.skipped" />
  <NbStat label="Errors" :value="result.errors" :status="result.errors ? 'danger' : 'neutral'" />
</NbCardGrid>

A status tile is filled with that status's quiet ground and every word on it is set in the matching ink, the pair the theme keeps legible in light and dark. Use a status when the colour is the meaning of the number (created, failed, waiting for review), not to decorate a row.

Tiles that do something ​

A tile behaves exactly like an NbCard, and picks its element the same way:

  • to renders a <RouterLink> when the app has vue-router: the tile takes the reader to the list the number counts.
  • href renders a plain <a>.
  • clickable renders a role="button" and emits select, for a tile that changes something in place, such as which metric the chart below plots. selected marks the one on show.
vue
<NbStat :label="t('items.total')" :value="total" :to="{ name: 'items' }" />
<NbStat
  :label="t('items.needsReview')"
  :value="pending"
  status="warning"
  :to="{ name: 'review' }"
/>

Dense row ​

size="sm" is for a row of figures that sits above a table or a chart and should not outweigh it: tighter padding and a smaller figure, 59px tall without a delta, against 86px for the default. Everything else is the same tile, so a dense tile still takes a status, a delta and a link.

vue
<NbCardGrid min="140px" gap="sm">
  <NbStat size="sm" label="Open" :value="counts.open" />
  <NbStat size="sm" label="Overdue" :value="counts.overdue" status="warning" />
</NbCardGrid>

Props ​

PropTypeDefaultDescription
labelstringWhat the number counts.
valuestring | number—The number, already formatted.
status'neutral' | 'info' | 'success' | 'warning' | 'danger''neutral'Tints the tile with a status.
deltastring—The change, already formatted.
trend'up' | 'down' | 'flat'—Which way the figure moved. Draws the arrow and colours the delta.
invertTrendbooleanfalseDown is good news. Changes the colour, never the arrow.
comparisonstring—What the delta is measured against.
size'sm' | 'md' | 'lg''md'sm for a dense KPI row, lg for the headline figure.
loadingbooleanfalsePlaceholder value, no delta, aria-busy.
tostring | object—Target route. A <RouterLink> with vue-router, a plain link for a string without.
hrefstring—Renders the tile as a link.
targetstring—Link target. _blank also sets rel="noopener".
clickablebooleanfalseRenders as a button and emits select. Ignored when to or href is set.
selectedbooleanfalseDraws the tile as chosen.
disabledbooleanfalseInert and muted.
hintstring—An info button beside the label that explains what the figure counts.
hintTitlestring—Bold heading above the hint's text.
iconTIconSource—A small, muted icon before the label.
arrowbooleanfalseAn arrow at the trailing edge of a tile that links (to or href).

Events ​

EventPayloadDescription
selectMouseEvent | KeyboardEventThe tile was activated by a click, Enter or Space. Only fires when clickable. The event carries the modifier keys, for a grid that selects a range with shift.

Slots ​

SlotDescription
labelReplaces the label prop, for a label with a help icon beside it.
valueReplaces the value prop.
deltaReplaces the arrow, delta and comparison.

Accessibility ​

  • The label comes first in the markup, so a link tile is announced as "Needs review, 12, link".
  • The arrow is decorative. Write the sign into delta (+12%, -3%), so the direction does not depend on the arrow or the colour.
  • A link or button tile has the focus ring every interactive surface in the library has.

Explaining the figure ​

hint puts an NbInfoHint beside the label, so a tile can say what it counts without a legend. hintTitle adds a heading to it. icon draws a small muted icon before the label, and arrow marks a tile that links with an arrow at its trailing edge.

vue
<NbStat
  icon="tray"
  label="Needs review"
  :value="pending"
  :to="{ name: 'review' }"
  arrow
  hint="Waiting for someone to approve them."
/>

On a tile that links or acts, the hint is not inside the link. The tile becomes a plain container, and the link or button is a sibling of the hint, stretched over the whole tile. Tab reaches the tile and the hint as two stops, clicking the hint opens it without navigating, and the tile is named by its label and figure. A tile without hint is still the link or button itself, as before.