Stats Card

Display key metrics with trends and icons.

Installation

bash
npx @smicolon/fasla-ui@latest add stats-card

Run init once per project before adding components. See Installation.

Preview

Revenue

SAR 48,200

+12.5%vs last month

Orders

1,284

+8%vs last month

Returns

36

-2.1%vs last month

Features

  • Title and value display
  • Trend indicator (up/down with percentage)
  • Optional icon
  • Description text
  • Loading state
  • StatsGrid for layout

Props

PropTypeDefaultDescription
titlestring—Label above the value.
valuestring | number—The main value.
descriptionstring—Text below the value.
iconReactNode—Icon in the corner.
trend{ value, direction: "up" | "down" | "neutral" }—Change, with an up or down arrow.
loadingbooleanfalseShows a skeleton while loading.
StatsGrid{ columns: 2 | 3 | 4 }—Lays the cards out in 2, 3 or 4 columns.
classNamestring—Extra classes for the component.

Usage

tsx
import { StatsCard, StatsGrid } from "@/components/blocks/stats-card"

export function StoreStats() {
  return (
    <StatsGrid columns={3}>
      <StatsCard
        title="Revenue"
        value="SAR 48,200"
        description="vs last month"
        trend={{ value: 12.5, direction: "up" }}
      />
      <StatsCard
        title="Orders"
        value="1,284"
        description="vs last month"
        trend={{ value: 8, direction: "up" }}
      />
      <StatsCard
        title="Returns"
        value="36"
        description="vs last month"
        trend={{ value: -2.1, direction: "down" }}
      />
    </StatsGrid>
  )
}