Skip to content

KPI tile

Compact tinted counters and neutral dashboard cards for one labelled metric.

View as Markdown

Preview

Jobs today

14
Jobs today
<div class="nx-kpi">
  <div class="nx-kpi__num">14</div>
  <div class="nx-kpi__lbl">Jobs today</div>
</div>

Variants

Dashboard card

One linked metric, with a decorative calendar icon and factual context.

<a class="nx-kpi nx-kpi--card nx-kpi--link" href="#kpi-tile">
  <dl class="nx-kpi__metric">
    <dt class="nx-kpi__heading">
      <span class="nx-kpi__lbl">Jobs today</span>
      <span class="nx-kpi__icon" aria-hidden="true">
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none"
            stroke="currentColor" stroke-width="2">
          <rect x="3" y="5" width="18" height="16" rx="2"/>
          <path d="M16 3v4M8 3v4M3 11h18"/>
        </svg>
      </span>
    </dt>
    <dd class="nx-kpi__num"><bdi>14</bdi></dd>
  </dl>
  <p class="nx-kpi__description">Scheduled for today</p>
</a>

API

React props (NxKit)

React (NxKit) props
PropTypeDefaultRequiredDescription
valueReactNodeRequiredThe complete metric; localized numbers/currencies are supplied by the host.
labelReactNodeRequiredVisible metric label.
variant"compact"|"card""compact"Compact tinted counter or full neutral dashboard card.
iconReactNodeundefinedCard only: decorative product-tinted icon.
descriptionReactNodeundefinedCard only: factual unit, period or supporting context.
hrefstringundefinedCard only: turns the entire card into one link.
linkComponentReact.ElementType"a"Card only: framework/locale link; supply from a client component when the router is client-owned.
classNamestring""Card only: optional layout class.

Classes

Framework-agnostic classes
ClassDescription
.nx-kpiCompact tile: accent-50 fill, 12px radius
.nx-kpi--cardNeutral bordered dashboard card, semantic label/value and tabular numerals
.nx-kpi--linkWhole-card link with hover tint and visible keyboard focus
.nx-stat-gridResponsive grid that fits available content width
.nx-kpi__numMetric value; ink in cards, accent-700 in compact counters
.nx-kpi__lblVisible secondary label
.nx-kpi__iconSmall decorative product-accent icon
.nx-kpi__descriptionOptional supporting context

Accessibility

  • Dashboard cards associate the visible label/value in a definition list and isolate localized values with bdi. Icons are decorative. Linked cards use native anchor semantics and a visible focus outline; static cards are not tab stops.
  • Keep slots free of nested controls. Never invent growth or trend data. The card grid wraps to available width, and long values remain readable.

Do / Don’t

  • Do: Use one labelled metric per card; add a real unit or period when needed.Don't use random per-metric colors or fabricate trend indicators.

View in spec