Hewn
Components

Components

AreaChart

Filled area chart for cumulative or volume trends.

newfree

Install

@hewnui/ui · hewnui

Terminal
npm install @hewnui/ui
Terminal
pnpm add @hewnui/ui
Terminal
yarn add @hewnui/ui
Terminal
bun add @hewnui/ui
Terminal
npx hewnui@latest add area-chart

AreaChart fills under each series with a translucent accent tint and draws the same monotone stroke as LineChart.

Active users this month

Usage

TSX
import { AreaChart } from "@hewnui/ui";

<AreaChart
  summary="Active users this month"
  series={[
    {
      id: "users",
      label: "Active",
      data: [
        { x: 1, y: 20 },
        { x: 2, y: 28 },
        { x: 3, y: 24 },
        { x: 4, y: 35 },
      ],
    },
  ]}
>
  <AreaChart.Tooltip />
</AreaChart>

Accessibility

  • The SVG is role="img" named by the required summary, which is also rendered as an sr-only caption
  • Every point is focusable and labelled "{series}: {x}, {y}", so the series can be read with Tab alone
  • Focus opens the same tooltip as hover, and blur closes it
  • Axis ticks and gridlines are aria-hidden — the summary carries the shape of the data
  • status="loading" and status="empty" announce through role="status"; status="error" uses role="alert"

API reference

Props for AreaChart from @hewnui/ui/area-chart. Generated from component types — not hand-written.

Prop

Type

On this page