EnterUI
DocsComponentsThemesExamplesDonation
Get Started
  • Component onboarding
    • Card
    • MetricCard
    • ChartCard
    • Badge
    • StatusIndicator
    • Rating

Default usage

  1. EnterUI
  2. /Docs
  3. /Foundations
  4. /Surfaces and Indicators
  5. /ChartCard
Updated 3 October 2026

ChartCard

A clear chart surface with a title, legend, actions, and a plot slot.

ChartCard gives EnterUI charts a consistent surface and hierarchy. Keep the plot directly on the card surface; use its legend and actions slots instead of placing a second frame around the data.

#Default usage

Revenue statistic

Blue and aqua series, visible axes, and a compact tooltip on hover or keyboard focus.

Revenue Statistic

  • Ads Sales
  • Referral Sales
40M30M20M10M0
Monthly revenue by sourceJan Ads Sales: 24000000Jan Referral Sales: 8000000Feb Ads Sales: 28000000Feb Referral Sales: 10000000Mar Ads Sales: 24000000Mar Referral Sales: 10000000Apr Ads Sales: 19000000Apr Referral Sales: 10000000May Ads Sales: 24000000May Referral Sales: 9000000Jun Ads Sales: 28000000Jun Referral Sales: 10000000Jul Ads Sales: 23000000Jul Referral Sales: 9000000Aug Ads Sales: 29000000Aug Referral Sales: 10000000Sep Ads Sales: 20000000Sep Referral Sales: 10000000Oct Ads Sales: 17000000Oct Referral Sales: 12000000Nov Ads Sales: 10000000Nov Referral Sales: 13000000Dec Ads Sales: 21000000Dec Referral Sales: 11000000
JanAprJulDec
Code
<ChartCard
  title="Revenue Statistic"
  legend={<Legend items={[{ label: "Ads Sales" }, { label: "Referral Sales" }]} />}
  actions={
    <>
      <Select defaultValue="monthly">
        <SelectTrigger aria-label="Period"><SelectValue /></SelectTrigger>
        <SelectContent><SelectItem value="monthly">Monthly</SelectItem></SelectContent>
      </Select>
      <Button variant="secondary">Export</Button>
    </>
  }
>
  <StackedBarChart
    ariaLabel="Monthly revenue by source"
    data={[
      { month: "Jan", ads: 24_000_000, referrals: 8_000_000 },
      { month: "Feb", ads: 28_000_000, referrals: 10_000_000 },
      { month: "Mar", ads: 24_000_000, referrals: 10_000_000 },
      { month: "Apr", ads: 19_000_000, referrals: 10_000_000 },
      { month: "May", ads: 24_000_000, referrals: 9_000_000 },
      { month: "Jun", ads: 28_000_000, referrals: 10_000_000 },
      { month: "Jul", ads: 23_000_000, referrals: 9_000_000 },
      { month: "Aug", ads: 29_000_000, referrals: 10_000_000 },
      { month: "Sep", ads: 20_000_000, referrals: 10_000_000 },
      { month: "Oct", ads: 17_000_000, referrals: 12_000_000 },
      { month: "Nov", ads: 10_000_000, referrals: 13_000_000 },
      { month: "Dec", ads: 21_000_000, referrals: 11_000_000 },
    ]}
    height={240}
    series={[{ key: "ads", label: "Ads Sales" }, { key: "referrals", label: "Referral Sales" }]}
    xKey="month"
  />
</ChartCard>

#Import

Code
import { Button, ChartCard, Legend, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, StackedBarChart } from "@froggdesign/enter-ui-react";

#Accessibility

ChartCard uses a heading for its title. Give the chart inside a descriptive ariaLabel or label; the card title alone does not name the chart. Chart bars expose their values through SVG titles and keyboard focus.

#API

  • title, description: header copy.
  • legend: series labels below the title and actions.
  • actions: optional controls in the header.
  • Extends native div props.

#Styling

The card uses the shared EnterUI surface, border, spacing, and chart tokens. Its plot has no second inset border.

#Dashboard composition

ChartCard owns its padding, heading size, actions, and plot spacing. Use the public layout primitives to place cards side by side; they wrap on narrow screens.

Code
<Grid min={380} gap={24}>
  <ChartCard title="Revenue trend" description="Daily recurring revenue · USD">
    <AreaChart data={revenue} xKey="day" yKey="value" ariaLabel="Revenue trend"
      curve="smooth" height={220} valueFormatter={(value) => `$${value}K`} />
  </ChartCard>
  <ChartCard title="Expansion pipeline" description="Qualified opportunities">
    <LineChart data={pipeline} xKey="day" yKey="value" ariaLabel="Expansion pipeline"
      curve="smooth" showDots height={220} />
  </ChartCard>
</Grid>

See the revenue dashboard for a complete composition using only component props and variants, without consumer CSS.

PreviousMetricCard
NextBadge
On this page
  • Default usage
  • Import
  • Accessibility
  • API
  • Styling
  • Dashboard composition