ValyroUI Русская версия

Stats Card

Metric cards. Free, MIT · Data and metrics › Metrics and widgets

Installation

npx valyro-cli@latest add stats-card
npx shadcn@latest add https://valyro.xyz/r/stats-card.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { StatsCard } from 'valyro-ui';

Props

PropTypeDefault
label *ReactNodeMetric name in the card header, e.g. "Revenue".
value *ReactNodeA number (formatted with locale and format) or pre-formatted content such as "$12,480".
formatIntl.NumberFormatOptionsNumber formatting for a numeric value, e.g. { notation: 'compact' } or a currency.
deltanumberChange in percent (12.5 → "12.5%"). The sign sets the arrow and color.
invertTrendbooleanfalseTreat a decrease as good news (error rate, latency, churn).
iconReactNodeDecorative icon at the end of the header, opposite the label (hidden from screen readers).
captionReactNodeContext next to the delta, e.g. "vs last week".
sparklinenumber[]Series for a small trend line. Needs at least two finite points.
loadingbooleanfalseSkeleton lines replace the value, delta and sparkline; the label stays. Sets aria-busy.
localestringNumber and percent formatting. Defaults to the ThemeProvider locale, then the browser's.
labelsPartial<StatsCardLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

  • KPI Group — KPI row: value, change vs. previous period, sparkline and progress to goal
  • Widget — Dashboard container: title, actions, big number, legend and chart area
  • Number Value — Locale-aware number: currency, percent, compact notation and units
  • Trend Value — Metric change: arrow, sign and color, as text or a pill
  • Proportion Bar — Proportion bar with a legend: storage, budget, breakdown
  • Activity Rings — Concentric progress rings toward goals
  • Leaderboard — Leaderboard: medal places, thumbnails, numbers and change over a period
  • Data Table — Tables with search and sorting
  • Data Grid — Grid for 100,000 rows: grouping, filters, inline editing
  • Virtual List — Virtual list for 100,000 rows
  • Bulk Action Bar — Actions for selected rows, with keyboard shortcuts
  • List Block — List with images or icons, descriptions and values

Previous: Empty State · Next: KPI Group · All Data and metrics