EEnterUI
DocsComponentsThemesDonation
Get Started
      • TrendIndicator
      • ComparisonMetric
EnterUIDocsData AnalyticsMetrics and ChartsTrends and ComparisonComparisonMetric
Data AnalyticsUpdated 6 May 2026

ComparisonMetric

Compact current-vs-previous or actual-vs-target metric.

ComparisonMetric pairs a primary value with optional previous-period, target, delta, and progress context.

#Default usage

Comparison metric

Use for KPI tiles that need current and previous context.

Revenue$42,800
↑+12.335958005249344%Previous $38,100Target $50,000
Code
<ComparisonMetric
  format="currency"
  label="Revenue"
  previousValue={38100}
  targetValue={50000}
  value={42800}
/>

#Import

Code
import { ComparisonMetric } from "@froggdesign/enter-ui-react";

#Patterns

Usage target

Target values render a compact meter that works inside any dashboard surface.

API calls210,000
↑+8.2%Previous 182,000Target 250,000

#Accessibility

When targetValue is present, ComparisonMetric renders a native meter with an accessible target percentage. The visible value remains the primary reading.

#API

  • label: metric label.
  • value: primary numeric or rendered value.
  • previousValue: previous period value.
  • targetValue: target or limit value.
  • delta: optional explicit delta; otherwise numeric previous/current values derive a percent delta.
  • format: number, percent, or currency.
  • currency: ISO currency code for currency formatting.
  • locale: locale passed to Intl.NumberFormat.
  • className: style hook for layout.
  • Legacy comparisonLabel, comparisonValue, and trend remain supported.

#Styling

ComparisonMetric uses .eui-comparison-metric, .eui-comparison-metric__label, .eui-comparison-metric__value, .eui-comparison-metric__meta, and .eui-comparison-metric__progress. Use className for card placement and let the component keep its neutral metric rhythm.

PreviousTrendIndicator
NextBarChart

On this page

  1. Default usage
  2. Import
  3. Patterns
  4. Accessibility
  5. API
  6. Styling