Skip to content
Data & ChartsPro

Chart Card

The card around a chart: title, optional headline value and trend, a period segment and legend chips above the plot.

See alsoArea ChartProMetric CardPro

Usage

Revenue

Revenue

Installation

Chart Card comes with WunderUI Core and Pro, in the package from your plan. See the plans.

Then import what you need:

tsx
import { ChartCard } from "@wunderui/react"

Examples

Area

Figma Type=area: title, the period segment top right and one legend chip per series.

Revenue

Revenue

Bar

Figma Type=bar-single: one series, the highlighted bar is today.

Active users

Users

Line

Figma Type=line: two series, each legend chip in its series colour.

Monthly revenue

20262025

Pie

Figma Type=pie: the narrow card with a description instead of the segment.

Traffic

By channel, this month

  • Direct46%
  • Organic28%
  • Referral16%
  • Other10%

Headline value

With value and delta the title becomes the small label above the number, the trend chip sits under it.

Revenue

$84,250

18.2%vs last year

Anatomy

The parts the component is made of. Each one renders a you can target from CSS.

  • data-slot="chart-card"

    The card around a chart: title or small label with an optional headline and trend chip, a period Segment on the right and legend chips above the plot.

Best practices

  • When to use

    Use ChartCard around any chart that needs a title, headline number or period switch. For a number without a chart use MetricCard.

  • Do

    Pass and for a headline: the then reads as a small label above the number. Use on when a fall is the good direction.

  • Do

    Give the same colours as the series, in the same order. Entries default to to , so a custom array needs matching values.

  • Do

    Handle the period with and , and reload the chart's data in that handler. alone only keeps its own selected state.

  • Don’t

    Don't add a second heading inside the chart. The card title is the heading; use for the unit or range.

  • Don’t

    Don't put a ChartCard inside another card. It is already a bordered, shadowed surface at least 320 px wide on larger screens.

API Reference

PropTypeDefault
children*ReactNode—
title*ReactNode—
actionReactNode—
classNamestring—
delta{ value: ReactNode; direction?: "up" | "down"; good?: boolean; caption?: ReactNode }—
descriptionstring—
hiddenSeriesstring[]—
legend{ label: string; color?: string; badge?: BadgeColor }[]—
onLegendToggle(label: string) => void—
onPeriodChange(period: string) => void—
periodstring—
periodsstring[]—
valueReactNode—

Theming

The CSS variables this component reads. Set one on any wrapper to restyle everything inside it. More in Theming.

VariableUsed forDefault
Color
Border#F1F5F7dark #323438
Background#FFFFFFdark #1C1D20
Text#000000dark #FFFFFF
Backgroundhover#F1F5F7dark #323438
Ringfocus#555CF3dark #999DF8
Text#D42A2Ddark #F8ADBC
Text#454648dark #D1D1D1
Text#0C7E5Adark #76E6C1
Text#6E6E70dark #A2A3A3
Radius
Corner radius16px
Motion
Duration150ms
Easingcubic-bezier(0.22, 1, 0.36, 1)