rechart
FreeNo executable scriptsNot checkedBuild responsive, readable charts with Recharts using correct data mapping and composition. Use whenever creating charts with Recharts — LineChart, BarChart…
by Asymmetric-al★ 354 GitHub starsAbout this skill
Recharts in Core
Core pins Recharts 3 (recharts in packages/ui/package.json and the app manifests). Build charts with the shared shadcn chart wrapper in packages/ui/components/shadcn/chart.tsx; packages/ui/components/primitives/chart-wrappers.tsx adds ChartCard and KpiTile compositions.
Rules
- Use
ChartContainer: It suppliesResponsiveContainer, theme-aware--color-<key>variables from aChartConfig, and token-based axis/grid styling. Default layout keeps an aspect ratio;layout="fill"fills a parent with a definite height class (no inlinestyle). - Theme colors: Set series colors in
ChartConfigwithchartColor(index)orvar(--chart-N), then referencevar(--color-<key>)infill/stroke. No raw palette colors. - Tooltips and legends: Use
ChartTooltipwithChartTooltipContentandChartLegendwithChartLegendContent; format money and units with the owning formatter. - Explicit data model: Normalize data and use stable
dataKeyvalues. Pick the simplest chart: line for trends, bar for comparisons, area for cumulative volume, pie only for part-to-whole. - Accessibility: Provide an accessible alternative (a table or text summary) for the data. If the chart is hidden from assistive technology, set
accessibilityLayer={false}and say why in a comment. - Performance: Set
isAnimationActive={false}for dashboards and large or frequently updated data, aggregate large sets, and considernext/dynamicto keep Recharts out of the initial bundle.
Checklist
- Chart wrapped in
ChartContainerwith aChartConfig - Series colors come from chart tokens via
--color-<key> -
dataKeyvalues match field names; tooltip shows correct units - Accessible alternative for the data exists
- Animation disabled where data is large or live
Example
See apps/admin/app/(app)/crm/giving-by-year-chart.tsx for a complete chart with next/dynamic, layout="fill", a formatted tooltip, and a table alternative.
import {
ChartContainer,
ChartTooltip,
ChartTooltipContent,
type ChartConfig,
} from "@asym/ui/components/shadcn/chart";
import { Bar, BarChart, CartesianGrid, XAxis } from "recharts";
const config = {
amount: { label: "Settled giving", color: "var(--chart-1)" },
} satisfies ChartConfig;
export function GivingBars({
data,
}: {
data: { label: string; amount: number }[];
}) {
return (
<ChartContainer config={config}>
<BarChart data={data}>
<CartesianGrid vertical={false} />
<XAxis dataKey="label" tickLine={false} axisLine={false} />
<ChartTooltip content={<ChartTooltipContent />} />
<Bar
dataKey="amount"
fill="var(--color-amount)"
radius={4}
isAnimationActive={false}
/>
</BarChart>
</ChartContainer>
);
}
Install rechart in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the rechart skill do?
Build responsive, readable charts with Recharts using correct data mapping and composition. Use whenever creating charts with Recharts — LineChart, BarChart, AreaChart, PieChart, wrapped in ResponsiveContainer with a fixed-height parent. Not for charts built with other libraries.
How do I install the rechart skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the rechart skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic