Back to Components
Cards

Metric Comparison

Compare two metrics side by side with visual bars and percentage difference.

This Month

48,290

Last Month

42,150

12.7% higher

Desktop

12,800 users

Mobile

18,400 users

30.4% higher

Dependencies

  • clsx
  • tailwind-merge

Files

  • components/ui/metric-comparison.tsx

Installation

Using shadcn CLI

npx shadcn add metric-comparison --url https://ui.hampton.io

Manual installation

Copy the component file to your project and install dependencies:

npm install clsx tailwind-merge