Data & feedback@neumorphism-ui/chart

Chart

Compose Recharts axes and series directly. Data marks stay flat and legible; neumorphic depth belongs to the surrounding surface.

@neumorphism-ui/chart
Registry JSON

Preview

Visits over time

Use the original data table for exact values.

View exact data
Visits over time
DateVisits
09-01140
09-02220
09-03175

Installation

Installation: chartnpx shadcn@latest add @neumorphism-ui/chart

The CLI resolves npm dependencies, base tokens, utilities, and component source in order.

New to this Registry? Set up the namespace before continuing.

Usage

Import

Chart import code
"use client";
import { Bar, BarChart, XAxis } from "recharts";
import { ChartContainer, ChartTooltip } from "@/components/ui/chart";

Example

Chart usage code
export default function Example() {
  const data = [{ date: "09-01", visits: 140 }, { date: "09-02", visits: 220 }, { date: "09-03", visits: 175 }];
  return <ChartContainer title="Daily visits" description="Illustrative data. Exact values are available in the table." tableLabel="View data" table={<table><caption>Daily visits</caption><thead><tr><th scope="col">Date</th><th scope="col">Visits</th></tr></thead><tbody>{data.map(row => <tr key={row.date}><th scope="row">{row.date}</th><td>{row.visits}</td></tr>)}</tbody></table>}>
    <BarChart data={data} accessibilityLayer><XAxis dataKey="date" /><ChartTooltip /><Bar dataKey="visits" name="Visits" fill="var(--primary)" isAnimationActive={false} /></BarChart>
  </ChartContainer>;
}

API Reference

ComponentPropTypeDefaultDescription
ChartContainertitle / descriptionrequiredstring—Readable chart title and description.
ChartContainertable / tableLabelrequiredReactNode / string—A table from the same data and its disclosure label.
ChartContainerempty / emptyLabelboolean / string—The state to display when no records are available.
ChartTooltippropsRecharts Tooltip props—Pass ordinary Recharts Tooltip options.

Accessibility

  • 01

    Use accessibilityLayer, redundant line styles and labels, and an exact-data table.

  • 02

    Examples disable animation. Applications own the motion policy of custom series.