Metric Card
⋯
The Metric card page renders the Figma Metric Chart Card, Metric Chart Modal, Metric Group Card,
.Metric Tile, KPI Summary Card, and Funnel Stage Card. The cards compose the Trend Indicator,
.Metric Label, Metric Value, and Metric Stat primitives with a card surface and, for chart cards,
a Line Chart Plot.
import { MetricValue, TrendIndicator } from "@nesra/ui/metric";
export function Spend() { return ( <MetricValue size="lg"> <MetricValue.Label definition="Total spend across active campaigns.">Spend</MetricValue.Label> <MetricValue.Amount unit="IDR" value="46,824.98" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> );}Every export on this page is also available from @nesra/ui.
Composition
Section titled “Composition”MetricValue Figma Metric Value├── MetricValue.Label .Metric Label, Type=Title├── MetricValue.Amount value row: prefix, value, unit└── MetricValue.Comparison comparison row: label + TrendIndicator
MetricStat Figma Metric Stat: value above a .Metric Label, Type=CaptionMetricLabel Figma .Metric LabelTrendIndicator Figma Trend IndicatorMetric cards:
MetricChartModal Dialog root shared by the card and the modal├── MetricChartCard Figma Metric Chart Card│ ├── MetricChartCard.Header title row│ │ ├── MetricChartCard.Title .Metric Label, Type=Title│ │ └── MetricChartCard.Actions revealed on hover or focus│ │ └── MetricChartModal.Trigger zoom button│ ├── MetricValue | MetricChartCard.Stats Type=Single | Type=Benchmark│ ├── AiInlineInsight optional, Show AI Insight│ ├── MetricChartCard.Chart optional legend + compact LineChartPlot│ └── MetricChartCard.Loading replaces the value and chart while loading└── MetricChartModal.Content Figma Metric Chart Modal: title and close button ├── MetricValue | MetricChartModal.Stats └── MetricChartModal.Chart optional legend + expanded LineChartPlot
MetricGroupCard Figma Metric Group Card├── MetricGroupCard.Title└── MetricGroupCard.Tiles └── MetricTile Figma .Metric Tile: MetricValue + MetricStat
KpiSummaryCard Figma KPI Summary Card├── KpiSummaryCard.Header icon, title, description, action└── KpiSummaryCard.Details ├── KpiSummaryCard.Value ├── KpiSummaryCard.Comparison text + badge TrendIndicator └── AiInlineInsight optional, Show AI Insight
FunnelStageCard.Group radio group for a funnel row└── FunnelStageCard Figma Funnel Stage Card: title, radio, pointer ├── FunnelStageCard.Value figure + optional action └── FunnelStageCard.Meta └── FunnelStageCard.MetaItem label + value, with FunnelStageCard.MetaMuted textExamples
Section titled “Examples”Trend Indicator
Section titled “Trend Indicator”variant="inline" renders the filled Signal caret with colored text. variant="badge" renders a
bordered chip with a trending icon. size="sm" uses Body/XSmall/Medium and size="md" uses
Body/Small/Medium.
import { TrendIndicator } from "@nesra/ui/metric";
export function TrendIndicatorExample() { return ( <div className="grid gap-4"> <div className="flex flex-wrap items-center gap-6"> <TrendIndicator direction="up" value="12.5%" /> <TrendIndicator direction="down" value="12.5%" /> <TrendIndicator direction="flat" value="0.00%" /> <TrendIndicator direction="up" size="md" value="12.5%" /> </div> <div className="flex flex-wrap items-center gap-6"> <TrendIndicator direction="up" value="12.5%" variant="badge" /> <TrendIndicator direction="down" value="12.5%" variant="badge" /> <TrendIndicator direction="flat" value="0.00%" variant="badge" /> <TrendIndicator direction="up" size="md" value="12.5%" variant="badge" /> </div> </div> );}Polarity
Section titled “Polarity”The icon always shows the real direction. polarity sets whether that direction is good. Use
lower-is-better for cost metrics such as CPA, CPM, or cost per result. flat is always neutral.
import { TrendIndicator } from "@nesra/ui/metric";
export function TrendPolarityExample() { return ( <dl className="grid grid-cols-[auto_auto] items-center gap-x-6 gap-y-3 type-nesra-body-small-regular text-nesra-text-body"> <dt>Clicks (higher is better)</dt> <dd className="flex gap-4"> <TrendIndicator direction="up" label="Clicks up 12% versus last week" value="12%" /> <TrendIndicator direction="down" label="Clicks down 3% versus last week" value="3%" /> </dd> <dt>Cost per result (lower is better)</dt> <dd className="flex gap-4"> <TrendIndicator direction="up" label="Cost per result up 12% versus last week" polarity="lower-is-better" value="12%" /> <TrendIndicator direction="down" label="Cost per result down 3% versus last week" polarity="lower-is-better" value="3%" /> </dd> </dl> );}Metric Label
Section titled “Metric Label”A definition adds the dashed underline and turns the label into a
Tooltip Trigger that opens the definition.
import { MetricLabel } from "@nesra/ui/metric";
export function MetricLabelExample() { return ( <div className="flex flex-wrap items-center gap-8"> <MetricLabel>Spend</MetricLabel> <MetricLabel definition="People who saw at least one ad during the period."> Reach </MetricLabel> <MetricLabel type="caption">Ranking</MetricLabel> <MetricLabel definition="Median result of advertisers with a similar budget." definitionTitle="Benchmark" type="caption" > Benchmark </MetricLabel> </div> );}Metric Value sizes
Section titled “Metric Value sizes”md uses Heading/H6, lg uses Heading/H5 for cards and tiles, and xl uses Heading/H4 for the
expanded modal. A TrendIndicator inside MetricValue.Comparison follows the size: sm for md
and md for lg and xl. Its own size prop overrides that.
import { MetricValue, TrendIndicator } from "@nesra/ui/metric";
const sizes = ["md", "lg", "xl"] as const;
export function MetricValueSizesExample() { return ( <div className="flex flex-wrap gap-10"> {sizes.map((size) => ( <MetricValue key={size} size={size}> <MetricValue.Label>Spend ({size})</MetricValue.Label> <MetricValue.Amount unit="IDR" value="46,824.98" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> ))} </div> );}Fill width
Section titled “Fill width”width="fill" spans the column. The unit and trend move to the end, and the value and comparison
label truncate with an ellipsis when the column is narrow.
import { MetricValue, TrendIndicator } from "@nesra/ui/metric";
export function MetricValueFillExample() { return ( <div className="grid w-full max-w-sm gap-6"> <MetricValue size="lg" width="fill"> <MetricValue.Label>Spend</MetricValue.Label> <MetricValue.Amount unit="IDR" value="46,824.98" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> <div className="w-44"> <MetricValue size="lg" width="fill"> <MetricValue.Label>Reach</MetricValue.Label> <MetricValue.Amount value="1,204,330,912" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="flat" value="0.00%" /> </MetricValue.Comparison> </MetricValue> </div> </div> );}Value and comparison tooltips
Section titled “Value and comparison tooltips”These are Figma’s “Show Value Tooltip” and “Show Comparison Tooltip”. exactValue on
MetricValue.Amount shows the exact figure behind a rounded or truncated value. previousValue on
MetricValue.Comparison shows the comparison figure, such as the previous period’s value. Each one
renders a Basic Tooltip below the target, aligned to its start (Figma Variant=Top, Position=Left):
the title in Body/XSmall/Regular and the value in Body/XSmall/Medium, in text-inverse on
bg-inverse. The titles default to “Exact value” and “Previous period”. Change them with
exactValueLabel and previousValueLabel.
The targets are native buttons. Hover, keyboard focus, or a tap opens the tooltip. Figma does not define a hover or pressed style for them, so the code adds only the focus ring.
import { MetricValue, TrendIndicator } from "@nesra/ui/metric";
export function MetricValueTooltipsExample() { return ( <div className="grid w-full max-w-60 gap-8"> <MetricValue> <MetricValue.Label>Spend</MetricValue.Label> <MetricValue.Amount exactValue="46,824.98 IDR" unit="IDR" value="46.8K" /> <MetricValue.Comparison label="Vs. previous period" previousValue="41,622.20 IDR"> <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> <MetricValue size="lg" width="fill"> <MetricValue.Label>Revenue</MetricValue.Label> <MetricValue.Amount exactValue="1,284,503,220.50 IDR" unit="IDR" value="1,284,503,220.50" /> <MetricValue.Comparison label="Vs. same week last year" previousValue="1,141,780,640.00 IDR" previousValueLabel="Same week last year" > <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> </div> );}Number formatting
Section titled “Number formatting”MetricValue.Amount and MetricStat never format numbers themselves. Pass display text as a
string, or pass a number with a formatter. The application chooses the locale, decimals,
currency, and compact notation, so server and client output match.
import { MetricStat, MetricValue, TrendIndicator } from "@nesra/ui/metric";
// The application owns the locale. Nesra UI only renders the formatted text.const rupiah = new Intl.NumberFormat("id-ID", { maximumFractionDigits: 0 });const count = new Intl.NumberFormat("id-ID");
export function MetricFormatterExample() { return ( <div className="flex flex-wrap items-end gap-10"> <MetricValue size="lg"> <MetricValue.Label>Cost per result</MetricValue.Label> <MetricValue.Amount formatter={rupiah.format} prefix="Rp" value={12400} /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="down" polarity="lower-is-better" value="4,1%" /> </MetricValue.Comparison> </MetricValue> <MetricStat formatter={count.format} label="Benchmark" value={17486428} /> </div> );}Metric Stat
Section titled “Metric Stat”import { MetricStat } from "@nesra/ui/metric";
export function MetricStatExample() { return ( <div className="flex flex-wrap gap-10"> <MetricStat definition="Median result of advertisers with a similar budget." label="Benchmark" value="17,486,428" /> <MetricStat label="Ranking" value="3 / 227" /> </div> );}Tile layout
Section titled “Tile layout”The Figma .Metric Tile pairs a fill-width Metric Value with a Metric Stat on the gray card
surface. Use align="end" for a definition at the right edge so the popup stays inside the card.
import { MetricStat, MetricValue, TrendIndicator } from "@nesra/ui/metric";
export function MetricTileExample() { return ( <div className="flex w-full max-w-sm items-end gap-6 rounded-nesra-xl bg-nesra-surface-card-bg-gray p-nesra-padding-2xl"> <MetricValue size="lg" width="fill"> <MetricValue.Label definition="People who saw at least one ad during the period."> Reach </MetricValue.Label> <MetricValue.Amount value="0" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="flat" value="0.00%" /> </MetricValue.Comparison> </MetricValue> <MetricStat align="end" definition="Median reach of advertisers with a similar budget." label="Benchmark" value="34,243,443" /> </div> );}Metric Chart Card
Section titled “Metric Chart Card”The Figma Type=Single card. On devices with hover, the zoom button appears while the pointer is
over the card or keyboard focus is inside the actions, and the card lifts to Box Shadow/shadow-lg.
On touch devices the button stays visible. The zoom button opens the Metric Chart Modal with the
expanded 480px plot.
import { MetricChartCard, MetricChartModal, MetricValue, TrendIndicator } from "@nesra/ui/metric";
const data = [ { id: "jul-01", label: "2026-07-01", values: { spend: 5200 } }, { id: "jul-22", label: "2026-07-22", values: { spend: 8600 } }, { id: "aug-12", label: "2026-08-12", values: { spend: 7300 } }, { id: "sep-02", label: "2026-09-02", values: { spend: 12400 } }, { id: "sep-23", label: "2026-09-23", values: { spend: 19900 } },];const series = [{ key: "spend", label: "Spend", color: "blue" as const }];const compact = new Intl.NumberFormat("en-US", { notation: "compact", minimumFractionDigits: 2 });const formatValue = (value: number) => (value === 0 ? "0.00" : compact.format(value));
function Spend({ size }: { size: "lg" | "xl" }) { return ( <MetricValue size={size}> <MetricValue.Amount unit="IDR" value="46,824.98" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> );}
export function MetricChartCardExample() { return ( <MetricChartModal> <MetricChartCard className="w-full max-w-[360px]"> <MetricChartCard.Header> <MetricChartCard.Title definition="Total spend across all active campaigns."> Spend </MetricChartCard.Title> <MetricChartCard.Actions> <MetricChartModal.Trigger label="Zoom in on Spend" /> </MetricChartCard.Actions> </MetricChartCard.Header> <Spend size="lg" /> <MetricChartCard.Chart data={data} formatValue={formatValue} label="Spend" series={series} summary="Daily spend in IDR from July to September 2026." /> </MetricChartCard> <MetricChartModal.Content title="Spend"> <Spend size="xl" /> <MetricChartModal.Chart data={data} formatValue={formatValue} label="Spend" series={series} summary="Daily spend in IDR from July to September 2026." /> </MetricChartModal.Content> </MetricChartModal> );}Benchmark type
Section titled “Benchmark type”MetricChartCard.Stats places a fill-width Metric Value beside Metric Stat columns. A chart with
more than one series shows a start-aligned legend. Inside MetricChartModal.Content, the stats row
gap grows from 16px to 32px and the Metric Value uses size="xl".
import { MetricChartCard, MetricChartModal, MetricStat, MetricValue, TrendIndicator,} from "@nesra/ui/metric";
const data = [ { id: "jul-01", label: "2026-07-01", values: { brand: 5200, benchmark: 1200 } }, { id: "jul-22", label: "2026-07-22", values: { brand: 8600, benchmark: 300 } }, { id: "aug-12", label: "2026-08-12", values: { brand: 7300, benchmark: 3100 } }, { id: "sep-02", label: "2026-09-02", values: { brand: 12400, benchmark: 11300 } }, { id: "sep-23", label: "2026-09-23", values: { brand: 19900, benchmark: 9300 } },];const series = [ { key: "brand", label: "Brand", color: "blue" as const }, { key: "benchmark", label: "Benchmark", color: "teal" as const },];const compact = new Intl.NumberFormat("en-US", { notation: "compact", minimumFractionDigits: 2 });const formatValue = (value: number) => (value === 0 ? "0.00" : compact.format(value));
function Stats({ size }: { size: "lg" | "xl" }) { return ( <> <MetricValue size={size} width={size === "lg" ? "fill" : "hug"}> <MetricValue.Amount value="72,752,330" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="up" value="12.5%" /> </MetricValue.Comparison> </MetricValue> <MetricStat align="center" definition="The average of the brands you selected as benchmark." label="Benchmark" value="17,486,428" /> <MetricStat align="end" definition="Your rank among the brands in this vertical." label="Ranking" value="3 / 227" /> </> );}
export function MetricChartCardBenchmarkExample() { return ( <MetricChartModal> <MetricChartCard className="w-full max-w-[360px]"> <MetricChartCard.Header> <MetricChartCard.Title definition="People who saw at least one ad."> Reach </MetricChartCard.Title> <MetricChartCard.Actions> <MetricChartModal.Trigger label="Zoom in on Reach" /> </MetricChartCard.Actions> </MetricChartCard.Header> <MetricChartCard.Stats> <Stats size="lg" /> </MetricChartCard.Stats> <MetricChartCard.Chart data={data} formatValue={formatValue} label="Reach" series={series} summary="Daily reach of your brand and the benchmark from July to September 2026." /> </MetricChartCard> <MetricChartModal.Content title="Reach"> <MetricChartModal.Stats> <Stats size="xl" /> </MetricChartModal.Stats> <MetricChartModal.Chart data={data} formatValue={formatValue} label="Reach" series={series} summary="Daily reach of your brand and the benchmark from July to September 2026." /> </MetricChartModal.Content> </MetricChartModal> );}AI insight
Section titled “AI insight”Figma Show AI Insight places a Tinted, sm AI Inline Insight after the
value and before the chart.
import { AiInlineInsight, AiLabel } from "@nesra/ui/ai";import { MetricChartCard, MetricValue, TrendIndicator } from "@nesra/ui/metric";
const data = [ { id: "jul-01", label: "2026-07-01", values: { cpr: 4100 } }, { id: "jul-22", label: "2026-07-22", values: { cpr: 3900 } }, { id: "aug-12", label: "2026-08-12", values: { cpr: 4300 } }, { id: "sep-02", label: "2026-09-02", values: { cpr: 3600 } }, { id: "sep-23", label: "2026-09-23", values: { cpr: 3400 } },];const series = [{ key: "cpr", label: "Cost per result", color: "blue" as const }];
export function MetricChartCardAiInsightExample() { return ( <MetricChartCard className="w-full max-w-[360px]"> <MetricChartCard.Header> <MetricChartCard.Title definition="Spend divided by the number of results."> Cost per result </MetricChartCard.Title> </MetricChartCard.Header> <MetricValue size="lg"> <MetricValue.Amount unit="IDR" value="3,400" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="down" polarity="lower-is-better" value="12%" /> </MetricValue.Comparison> </MetricValue> <AiInlineInsight> <AiLabel description="Generated from the last 90 days of delivery data." /> <AiInlineInsight.Content> <AiInlineInsight.Text> Cost per result fell <AiInlineInsight.Value tone="success">12%</AiInlineInsight.Value>{" "} after budget moved to the best ad set. </AiInlineInsight.Text> </AiInlineInsight.Content> </AiInlineInsight> <MetricChartCard.Chart data={data} formatValue={(value) => value.toLocaleString("en-US")} label="Cost per result" series={series} summary="Daily cost per result in IDR from July to September 2026." /> </MetricChartCard> );}Loading
Section titled “Loading”MetricChartCard.Loading replaces the value and the plot with skeletons in a busy status region.
Keep the header so the card keeps its name.
import { MetricChartCard } from "@nesra/ui/metric";
export function MetricChartCardLoadingExample() { return ( <MetricChartCard className="w-full max-w-[360px]"> <MetricChartCard.Header> <MetricChartCard.Title>Spend</MetricChartCard.Title> </MetricChartCard.Header> <MetricChartCard.Loading /> </MetricChartCard> );}Metric Group Card
Section titled “Metric Group Card”MetricTile is the Figma .Metric Tile. The tile grid has one column. Add grid column classes,
such as sm:grid-cols-2, to MetricGroupCard.Tiles for a wider card.
import { MetricGroupCard, MetricStat, MetricTile, MetricValue, TrendIndicator,} from "@nesra/ui/metric";
export function MetricGroupCardExample() { return ( <MetricGroupCard className="w-full max-w-[360px]"> <MetricGroupCard.Title>Reach and frequency</MetricGroupCard.Title> <MetricGroupCard.Tiles> <MetricTile> <MetricValue size="lg" width="fill"> <MetricValue.Label definition="People who saw at least one ad."> Reach </MetricValue.Label> <MetricValue.Amount value="0" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="flat" value="0.00%" /> </MetricValue.Comparison> </MetricValue> <MetricStat align="end" definition="The average of the brands you selected as benchmark." label="Benchmark" value="34,243,443" /> </MetricTile> <MetricTile> <MetricValue size="lg"> <MetricValue.Label definition="Average number of times each person saw an ad."> Frequency </MetricValue.Label> <MetricValue.Amount value="0.00" /> <MetricValue.Comparison label="Vs. previous period"> <TrendIndicator direction="flat" value="0.00%" /> </MetricValue.Comparison> </MetricValue> </MetricTile> </MetricGroupCard.Tiles> </MetricGroupCard> );}KPI Summary Card
Section titled “KPI Summary Card”Trending Down and Trending Up are Trend Indicator directions inside KpiSummaryCard.Comparison.
The header action is any control the page owns, such as a Checkbox with an accessible name.
import { Checkbox } from "@nesra/ui/checkbox";import { KpiSummaryCard, TrendIndicator } from "@nesra/ui/metric";import { Info } from "lucide-react";
export function KpiSummaryCardExample() { return ( <div className="flex flex-wrap gap-4"> {(["down", "up"] as const).map((direction) => ( <KpiSummaryCard className="w-[275px]" key={direction}> <KpiSummaryCard.Header action={<Checkbox aria-label={`Compare revenue, trending ${direction}`} />} description="All stores" icon={<Info />} title="Revenue" /> <KpiSummaryCard.Details> <KpiSummaryCard.Value>Rp 999.000.000</KpiSummaryCard.Value> <KpiSummaryCard.Comparison label={direction === "up" ? "Up from last week" : "Down from last week"} > <TrendIndicator direction={direction} value="12.5%" variant="badge" /> </KpiSummaryCard.Comparison> </KpiSummaryCard.Details> </KpiSummaryCard> ))} </div> );}KPI Summary Card with AI insight
Section titled “KPI Summary Card with AI insight”Figma Show AI Insight places a Tinted, sm AI Inline Insight at the bottom of
KpiSummaryCard.Details. Keep the copy to two lines at the 275px card width.
import { AiInlineInsight, AiLabel } from "@nesra/ui/ai";import { KpiSummaryCard, TrendIndicator } from "@nesra/ui/metric";import { Info } from "lucide-react";
export function KpiSummaryCardAiInsightExample() { return ( <KpiSummaryCard className="w-[275px]"> <KpiSummaryCard.Header description="All stores" icon={<Info />} title="Revenue" /> <KpiSummaryCard.Details> <KpiSummaryCard.Value>Rp 999.000.000</KpiSummaryCard.Value> <KpiSummaryCard.Comparison label="Down from last week"> <TrendIndicator direction="down" value="12.5%" variant="badge" /> </KpiSummaryCard.Comparison> <AiInlineInsight> <AiLabel description="Generated from the last 7 days of orders." /> <AiInlineInsight.Content> <AiInlineInsight.Text>Fewer repeat orders after the promo ended.</AiInlineInsight.Text> </AiInlineInsight.Content> </AiInlineInsight> </KpiSummaryCard.Details> </KpiSummaryCard> );}Funnel Stage Card
Section titled “Funnel Stage Card”Each card is one radio in FunnelStageCard.Group. A press on the card surface selects its stage.
A press on the title definition, a meta definition, or the action does not. The selected card turns
Categorical/Blue/subtle with a 1.5px Stroke/stroke-link border and a pointer toward the detail
panel below. The page renders that panel from the selected value.
import { Button } from "@nesra/ui/button";import { FunnelStageCard } from "@nesra/ui/metric";import { TooltipTrigger } from "@nesra/ui/tooltip";import { Plus } from "lucide-react";import { useState } from "react";
const stages = [ { value: "awareness", title: "Awareness", figure: "73.419.714", benchmark: "82.787.501", rank: 6, }, { value: "consideration", title: "Consideration", figure: "12.884.020", benchmark: "10.402.118", rank: 12, }, { value: "conversion", title: "Conversion", figure: "1.204.556", benchmark: "1.508.230", rank: 18, }, { value: "loyalty", title: "Loyalty", figure: "310.882", benchmark: "280.114", rank: 9 },];
export function FunnelStageCardExample() { const [stage, setStage] = useState<string>("awareness"); const selected = stages.find((item) => item.value === stage);
return ( <div className="flex w-full flex-col gap-2"> <FunnelStageCard.Group aria-label="Funnel stages" onValueChange={(value) => setStage(value)} value={stage} > {stages.map((item) => ( <FunnelStageCard definition={ <> Audiences in the <strong>{item.title}</strong> stage in the past 15 days. </> } definitionTitle={`${item.title} audience`} key={item.value} title={item.title} value={item.value} > <FunnelStageCard.Value action={ <Button aria-label={`Add ${item.title} audience`} size="icon-sm"> <Plus aria-hidden="true" /> </Button> } > {item.figure} </FunnelStageCard.Value> <FunnelStageCard.Meta> <FunnelStageCard.MetaItem definition="The average of the brands you selected as benchmark." label="Benchmark:" > {item.benchmark} </FunnelStageCard.MetaItem> <FunnelStageCard.MetaItem label="Ranking:"> {item.rank} <FunnelStageCard.MetaMuted>/</FunnelStageCard.MetaMuted> <TooltipTrigger description="Total onboarded brands in this vertical." size="xs" tone="muted" > 225 </TooltipTrigger> </FunnelStageCard.MetaItem> </FunnelStageCard.Meta> </FunnelStageCard> ))} </FunnelStageCard.Group> <p className="m-0 type-nesra-body-small-regular text-nesra-text-support"> Showing details for {selected?.title}. </p> </div> );}Light and Dark
Section titled “Light and Dark”The primitives read only semantic roles, so the same markup follows the page theme.
| Part | Figma variable |
|---|---|
| Inline, positive | Text/text-success, Icon/icon-success |
| Inline, negative | Text/text-destructive, Icon/icon-destructive |
| Inline, flat | Text/text-support, Icon/icon-muted |
| Badge, positive | Categorical/Green/subtle, Stroke/stroke-success, Categorical/Green/foreground |
| Badge, negative | Categorical/Red/subtle, Stroke/stroke-destructive, Categorical/Red/foreground |
| Badge, flat | Foundation/bg-gray, Stroke/stroke-border, Text/text-body, Icon/icon-muted |
| Title label, value, stat value | Text/text-headline |
| Caption label, comparison label | Text/text-support |
| Unit and prefix | Text/text-body |
| Definition underline | Stroke/stroke-border-strong, Stroke/stroke-link on hover and open |
| Value and comparison tooltips | Foundation/bg-inverse, Text/text-inverse |
The cards read these Figma variables. Use the theme select in the header to compare both modes.
| Card part | Figma variable |
|---|---|
| Chart card, group card, KPI details surface | Surface/card-bg-neutral |
| Chart card and group card border | Stroke/stroke-border |
| Chart card hover, Funnel Stage Card hover | Box Shadow/shadow-lg, Box Shadow/shadow-md |
| Modal surface | Surface/popover-bg-neutral, 1px Stroke/stroke-border, Box Shadow/shadow-xl |
| Modal and group card title | Text/text-headline, Body/Large/Semibold |
| Plot tooltip | Foundation/bg-inverse, Text/text-inverse |
| Tile, KPI card, unselected Funnel Stage Card | Surface/card-bg-gray |
| KPI details border | Stroke/stroke-divider |
| KPI icon, zoom and close icons | Icon/icon-neutral |
| Selected Funnel Stage Card and pointer | Categorical/Blue/subtle, Stroke/stroke-link |
| Funnel Stage Card focus | Box Shadow/Focus ring |
| Funnel meta label, meta value | Text/text-support, Text/text-body |
| Funnel action | Primary Button: Action/primary-default, Icon/icon-on-brand |
Accessibility
Section titled “Accessibility”TrendIndicatorhides its visible value from assistive technology and renders screen-reader text instead. The default text is the direction and the value, such as “Up 12.5%”. Passlabelto add the metric or period, such as “Cost per result up 12% versus last week”.- Color shows sentiment, while the icon shape and the text carry the direction. Do not rely on
color alone to say whether a change is good. Name the metric in visible text or in
label. - The default direction words come from the
Up {value},Down {value}, andNo change {value}keys of interface translations. - A label with a
definitionis a native button. Hover, keyboard focus, or a tap opens the definition, and the definition is also the button’s accessible description. MetricStatrenders the caption before the value in the DOM, so a screen reader announces “Benchmark 17,486,428”. CSS shows the value above the caption.- Truncated values keep their full text in the DOM. Set
exactValueto show the exact value to sighted users in a tooltip. - With
exactValue, the prefix and figure are one button named by the visible figure. WithpreviousValue, the comparison label and Trend Indicator are one button, so do not put other interactive content in that row. The tooltip title and value are each button’s accessible description, even while the tooltip is closed. - These tooltips use Base UI Tooltip, the Figma Basic Tooltip. Base UI ignores touch for hover, so a press also opens the tooltip. A second press keeps it open. Escape, blur, pointer exit, or an outside press closes it. Focus stays on the button.
- The “Exact value” and “Previous period” defaults come from interface translations.
MetricChartModal.Triggeris a button named bylabel, which defaults to “Zoom in”. Name the metric, such as “Zoom in on Spend”, when a page has several cards. Hidden actions stay in the tab order, and focus reveals them.MetricChartModal.Contentis a dialog named by itstitle. Focus moves into it on open, Escape and the close button close it, and focus returns to the zoom button. The close button is named bycloseLabel, which defaults to “Close”.MetricChartCard.Chartrenders aLineChartPlotfigure with a hidden data table. Itslabelandsummaryname and describe the figure.MetricChartCard.Loadingis a busy<output>with the default text “Loading metric”.FunnelStageCard.Groupis a radio group. Give it anaria-labeloraria-labelledby. Each radio is named by its card title. Tab reaches the selected radio, arrow keys move between stages and select them, and the card shows the focus ring while its radio has keyboard focus. Definitions and actions inside a card are separate Tab stops.KpiSummaryCard.Headerhides its icon from assistive technology. Give the headeractionits own accessible name.- The “Zoom in”, “Close”, and “Loading metric” defaults come from interface translations.
API reference
Section titled “API reference”TrendIndicator
Section titled “TrendIndicator”Renders a <span> and forwards native span attributes, className, and its ref.
| Prop | Type | Default | Effect |
|---|---|---|---|
direction |
"up" | "down" | "flat" |
Required | Sets the icon and the direction word. |
value |
string |
Required | Preformatted change, including its unit. |
polarity |
"higher-is-better" | "lower-is-better" |
"higher-is-better" |
Sets whether up is positive or negative. Flat is always neutral. |
variant |
"inline" | "badge" |
"inline" |
Caret with colored text, or a bordered chip with a trending icon. |
size |
"sm" | "md" |
"sm" |
Text and icon size. Inside MetricValue.Comparison, follows the Metric Value. |
label |
string |
— | Replaces the screen-reader text. |
The span has data-slot="trend-indicator", data-direction, data-sentiment, data-variant,
and data-size. getTrendSentiment(direction, polarity) returns "positive", "negative", or
"neutral" for a matching color elsewhere, such as an insight number.
MetricLabel
Section titled “MetricLabel”Renders a <span data-slot="metric-label"> and forwards its ref to that span.
| Prop | Type | Default | Effect |
|---|---|---|---|
children |
ReactNode |
Required | Metric name. |
type |
"title" | "caption" |
"title" |
Body/Medium/Semibold headline text, or Body/Small/Regular support text. |
definition |
ReactNode |
— | Renders a Tooltip Trigger button with this definition. |
definitionTitle |
ReactNode |
— | Heading inside the definition popup. |
align |
"start" | "center" | "end" |
"start" |
Aligns the definition popup with the label. |
className |
string |
— | Classes for the outer span. |
MetricValue
Section titled “MetricValue”Renders a <div data-slot="metric-value"> and forwards native div attributes and its ref.
| Prop | Type | Default | Effect |
|---|---|---|---|
size |
"md" | "lg" | "xl" |
"md" |
Heading/H6, H5, or H4 for the value, with matching unit and comparison text. |
width |
"hug" | "fill" |
"hug" |
Keeps parts adjacent, or spans the column and truncates. |
MetricValue.Label
Section titled “MetricValue.Label”Renders a MetricLabel with type="title". It accepts every MetricLabel prop except type.
MetricValue.Amount
Section titled “MetricValue.Amount”Renders a <div data-slot="metric-value-amount"> and forwards native div attributes and its ref.
| Prop | Type | Default | Effect |
|---|---|---|---|
value |
string | number |
Required | Display text, or a number for formatter. |
formatter |
(value: number) => string |
Required for a number | Converts a numeric value to display text. |
prefix |
ReactNode |
— | Text before the value, in the unit style. |
unit |
ReactNode |
— | Text after the value, such as a currency code. |
exactValue |
ReactNode |
— | Exact figure in the value tooltip. Makes the prefix and figure a button. |
exactValueLabel |
ReactNode |
"Exact value" |
Title of the value tooltip. |
MetricValue.Comparison
Section titled “MetricValue.Comparison”Renders a <div data-slot="metric-value-comparison"> and forwards native div attributes and its
ref. Put a TrendIndicator in children.
| Prop | Type | Default | Effect |
|---|---|---|---|
label |
ReactNode |
— | Comparison period before the trend. |
previousValue |
ReactNode |
— | Comparison figure in the comparison tooltip. Makes the label and trend a button. |
previousValueLabel |
ReactNode |
"Previous period" |
Title of the comparison tooltip. |
MetricStat
Section titled “MetricStat”Renders a <div data-slot="metric-stat"> and forwards native div attributes and its ref.
| Prop | Type | Default | Effect |
|---|---|---|---|
label |
ReactNode |
Required | Caption below the value. |
value |
string | number |
Required | Display text, or a number for formatter. |
formatter |
(value: number) => string |
Required for a number | Converts a numeric value to display text. |
definition |
ReactNode |
— | Turns the caption into a Tooltip Trigger. |
definitionTitle |
ReactNode |
— | Heading inside the definition popup. |
align |
"start" | "center" | "end" |
"start" |
Aligns the definition popup with the caption. |
The prop types TrendIndicatorProps, MetricLabelProps, MetricValueProps,
MetricValueLabelProps, MetricValueAmountProps, MetricValueComparisonProps, MetricStatProps,
and MetricNumberProps are exported, with the value types TrendDirection, TrendPolarity,
TrendSentiment, TrendIndicatorVariant, TrendIndicatorSize, MetricLabelType,
MetricValueSize, and MetricValueWidth.
MetricChartCard
Section titled “MetricChartCard”Renders a <div data-slot="metric-chart-card"> and forwards native div attributes and its ref.
Parts forward their native attributes and refs.
| Part | Renders | Props |
|---|---|---|
MetricChartCard.Header |
<div> row, 32px min height |
Native div props. |
MetricChartCard.Title |
MetricLabel title type |
Every MetricLabel prop except type. |
MetricChartCard.Actions |
<div> revealed on hover |
Native div props. |
MetricChartCard.Stats |
<div> bottom-aligned row |
Native div props. 16px gap in the card, 32px in a modal. |
MetricChartCard.Chart |
legend and LineChartPlot |
See below. |
MetricChartCard.Loading |
busy <output> |
label?: string, default “Loading metric”. |
MetricChartCard.Chart accepts every LineChartPlot prop, including the required label,
summary, data, and series, plus:
| Prop | Type | Default | Effect |
|---|---|---|---|
showLegend |
boolean |
true with more than one series |
Shows the series labels above the plot. |
size |
"compact" | "expanded" |
compact in a card, expanded in a modal |
Plot height: 200px or 480px. |
MetricChartModal
Section titled “MetricChartModal”Accepts the Dialog root props, such as open, defaultOpen, and
onOpenChange.
| Part | Renders | Props |
|---|---|---|
MetricChartModal.Trigger |
Ghost icon-sm Button with a tooltip |
label?: string and tooltip?: ReactNode, both default “Zoom in”, plus Button props except variant, size, and children. |
MetricChartModal.Content |
Dialog content, up to 1200px wide | Required title: ReactNode, closeLabel?: string (default “Close”), plus Dialog content props. |
MetricChartModal.Stats |
The MetricChartCard.Stats part |
Native div props. |
MetricChartModal.Chart |
The MetricChartCard.Chart part |
Same as MetricChartCard.Chart, expanded by default. |
MetricGroupCard and MetricTile
Section titled “MetricGroupCard and MetricTile”MetricGroupCard renders a <div data-slot="metric-group-card">. MetricTile renders a
<div data-slot="metric-tile">. Both forward native div attributes and refs.
| Part | Renders | Props |
|---|---|---|
MetricGroupCard.Title |
heading | as?: "h2" | "h3" | "h4" | "h5" | "h6", default h3, plus native heading props. |
MetricGroupCard.Tiles |
<div> grid |
Native div props. One column with a 16px gap. |
KpiSummaryCard
Section titled “KpiSummaryCard”Renders a <div data-slot="kpi-summary-card"> and forwards native div attributes and its ref.
| Part | Props |
|---|---|
KpiSummaryCard.Header |
Required title: ReactNode. Optional description, icon (24px, decorative), and action nodes. Native div props. |
KpiSummaryCard.Details |
Native div props. |
KpiSummaryCard.Value |
Native div props. Children are display text in Heading/H6. |
KpiSummaryCard.Comparison |
label?: ReactNode. Children are a TrendIndicator. Native div props. |
FunnelStageCard
Section titled “FunnelStageCard”Renders a <div data-slot="funnel-stage-card"> with a Base UI radio. It must be inside
FunnelStageCard.Group.
| Prop | Type | Default | Effect |
|---|---|---|---|
value |
string |
Required | Stage value reported by the group. |
title |
ReactNode |
Required | Stage name. It names the radio. |
definition |
ReactNode |
— | Renders the title as a Tooltip Trigger with a Rich Tooltip. |
definitionTitle |
ReactNode |
— | Heading inside the definition popup. |
disabled |
boolean |
false |
Prevents selecting the stage. |
onClick |
(event) => void |
— | Runs before the card selects its stage. preventDefault() cancels the selection. |
| Part | Props |
|---|---|
FunnelStageCard.Group |
Base UI radio group props with value?: string | null, defaultValue?: string | null, and onValueChange?: (value: string, details) => void. |
FunnelStageCard.Value |
action?: ReactNode. Children are the figure in Heading/H5. Native div props. |
FunnelStageCard.Meta |
Native <dl> props. |
FunnelStageCard.MetaItem |
Required label: ReactNode, optional definition and definitionTitle. Children are the value. |
FunnelStageCard.MetaMuted |
Native span props for support-colored text inside a value, such as “/”. |
Each part’s prop type is exported with the part’s name and a Props suffix, such as
MetricChartCardChartProps, MetricChartModalContentProps, MetricTileProps,
KpiSummaryCardHeaderProps, and FunnelStageCardGroupProps.
See colors, typography, and layout for the token contract.