Skip to content

Stat

DataMIT
View in Storybook

KPI metric card with trend indicator, icon, and period comparison. Group with StatGroup.

bun add @otfdashkit/ui

Preview

Stat
Loading Storybook preview…

Code

import { User, BarChart2, Star } from 'lucide-react'
import { Stat, StatGroup } from '@otfdashkit/ui'

export function Example() {
  return (
    <StatGroup className="max-w-2xl">
      <Stat label="Total Revenue" value="$48,295" trend={12.5} trendLabel="vs last month" icon={<BarChart2 className="h-5 w-5" />} />
      <Stat label="Active Users" value="2,340" trend={-3.2} trendLabel="vs last week" icon={<User className="h-5 w-5" />} />
      <Stat label="Avg Rating" value="4.8" trend={0.3} trendLabel="this quarter" icon={<Star className="h-5 w-5" />} />
    </StatGroup>
  )
}

Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.

Kit for this component

SaaS Dashboard Kit$99

Show one metric with its label and change for a dashboard.

See the kit

Props

Props declared in the Stat source. Inherited HTML attributes are not listed.

PropTypeDefaultDescription
labelrequiredstring
valuerequiredstring | number
classNamestring
descriptionstring
iconReactNode
trendnumber
trendLabelstring