Tapas UI
Esc
  • IntroductionGetting startedWhat Tapas UI is and where to start.
  • InstallationGetting startedSet up shadcn/ui and add your first section.
  • CLI & AI agentsGetting startedThe shadcn CLI, the @tapas namespace, the MCP server and AI prompts.
  • TemplatesGetting startedWhole pages built from sections, installed with one command.
  • Demo sitesGetting startedThree fictional sites built only from Tapas sections.
  • ThemingCustomizationHow sections pick up your colors and radius.
  • ColorsCustomizationEvery CSS variable sections read, what it is for and where it is used.
  • Dark modeCustomizationSections follow your .dark variables.
  • MotionCustomizationPlain and motion versions, reduced motion and pause controls.
  • AccessibilityCustomizationWhat every section guarantees.
  • Waitlist formsGuidesPost signups to your own API route and store them.
  • Checkout linksGuidesPoint pricing buttons at Stripe payment links or any URL.
Menu
Browse the docs

DocsCards

Statistics card

A metric with an optional icon and an up, down or flat percentage change.

Preview

Version
Preview theme color
More themes

Counts up to its number once it scrolls into view, then lifts on hover. With reduced motion turned on, it renders the plain layout.

Monthly active users
125,430

Up+12.5% vs last month

Monthly active users
125,430

Up+12.5% vs last month

Installation

Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.

Usage

import { StatisticsCard } from "@/components/custom/statistics-card";

<StatisticsCard
  title="Monthly active users"
  value="125,430"
  change={12.5}
  changePeriod="vs last month"
  icon={Users}
/>
import { StatisticsCardMotion } from "@/components/custom/statistics-card/statistics-card-motion";

<StatisticsCardMotion {...props} />

Props

PropTypeDefaultDescription
title* (required)string–Metric name.
value* (required)string | number–The number to show.
changenumber–Percentage change; positive, negative or zero sets the trend.
changePeriodstring"from last month"What the change compares against.
descriptionstring–Extra line under the value.
iconLucideIcon–Icon next to the title.
iconColorstring"text-primary"Tailwind classes for the icon color.
prefixstring""Text before the value, such as $.
suffixstring""Text after the value, such as %.
...propsReact.ComponentProps<"div">–Any other div attribute (id, aria-*, data-*, ref) goes to the root element.
PropTypeDefaultDescription
title* (required)string–Metric name.
value* (required)string | number–The number to show.
changenumber–Percentage change; positive, negative or zero sets the trend.
changePeriodstring"from last month"What the change compares against.
descriptionstring–Extra line under the value.
iconLucideIcon–Icon next to the title.
iconColorstring"text-primary"Tailwind classes for the icon color.
prefixstring""Text before the value, such as $.
suffixstring""Text after the value, such as %.
...propsReact.ComponentProps<"div">–Any other div attribute (id, aria-*, data-*, ref) goes to the root element.

Accessibility

  • The trend arrow has a visually hidden label, so the direction is not conveyed by color alone.
  • The motion version follows the visitor's reduced-motion setting and never hides content before it animates.