BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/gaia/pie-chart

Pie Chart

gaia/pie-chart
FreeComponent

A pie chart for proportions with donut, label, and legend display modes.

Install it

npx shadcn@latest add https://ui.heygaia.io/r/pie-chart.json

Source

registry/new-york/ui/pie-chart.tsxui.heygaia.io/r/pie-chart.json
1"use client";
2
3import * as React from "react";
4import {
5 Cell,
6 Label,
7 Pie,
8 PieChart as RechartsPieChart,
9} from "recharts";
10import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card";
11import {
12 type ChartConfig,
13 ChartContainer,
14 ChartLegend,
15 ChartLegendContent,
16 ChartTooltip,
17 ChartTooltipContent,
18} from "@/components/ui/chart";
19
20const PIE_COLORS = ["#00bbff", "#34d399", "#60a5fa", "#a78bfa", "#f472b6"];
21
22function ChartCard({
23 title,
24 description,
25 footer,
26 children,
27 dataPoints = 0,
28}: {
29 title?: string;
30 description?: string;
31 footer?: string;
32 children: React.ReactNode;
33 dataPoints?: number;
34}) {
35 const maxWidth =
36 dataPoints > 0 ? Math.min(768, Math.max(300, dataPoints * 80)) : undefined;
37 return (
38 <Card
39 className="w-full max-w-3xl"
40 style={maxWidth ? { maxWidth } : undefined}
41 >
42 {(title || description) && (
43 <CardHeader className="pb-0">
44 {title && (
45 <p className="text-sm font-semibold text-card-foreground">
46 {title}
47 </p>
48 )}
49 {description && (
50 <p className="text-xs text-muted-foreground">{description}</p>
51 )}
52 </CardHeader>
53 )}
54 <CardContent>{children}</CardContent>
55 {footer && (
56 <CardFooter>
57 <p className="text-xs text-muted-foreground">{footer}</p>
58 </CardFooter>
59 )}
60 </Card>
61 );
62}
63
64export type PieChartProps = {
65 data: Array<Record<string, string | number>>;
66 nameKey: string;
67 valueKey: string;
68 title?: string;
69 description?: string;
70 footer?: string;
71 mode?: "donut" | "legend" | "label";
72};
73
74export function PieChart(props: PieChartProps) {
75 const mode = props.mode ?? "donut";
76 const chartConfig: ChartConfig = Object.fromEntries(
77 props.data.map((entry, i) => {
78 const name = String(entry[props.nameKey] ?? i);
79 return [name, { label: name, color: PIE_COLORS[i % PIE_COLORS.length] }];
80 }),
81 );
82 const total = React.useMemo(
83 () =>
84 props.data.reduce((sum, entry) => {
85 const val = entry[props.valueKey];
86 return sum + (typeof val === "number" ? val : 0);
87 }, 0),
88 [props.data, props.valueKey],
89 );
90 return (
91 <ChartCard
92 title={props.title}
93 description={props.description}
94 footer={props.footer}
95 dataPoints={props.data.length}
96 >
97 <ChartContainer
98 config={chartConfig}
99 className={`h-50 w-full ${mode === "label" ? "[&_.recharts-pie-label-text]:fill-foreground" : ""}`}
100 >
101 <RechartsPieChart>
102 {mode === "donut" ? (
103 <Pie
104 data={props.data}
105 dataKey={props.valueKey}
106// … truncated

What it pulls in

npm packages

  • recharts

Other registry items

  • chart
  • card

Files it writes

  • registry/new-york/ui/pie-chart.tsx

Facts

Registry
gaia
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-06
Last confirmed
yesterday

Go to the source

ui.heygaia.io theexperiencecompany/gaia-ui on GitHub Raw registry item This item as JSON

More from gaia

All 28 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Area Chartarea-chartgaiaComponentsFree1 dep
Author Tooltipauthor-tooltipgaiaComponentsFreeno deps
Bar Chartbar-chartgaiaComponentsFree1 dep
Chat Demochat-demogaiaComponentsFreeno deps
ComposercomposergaiaComponentsFreeno deps
Email Compose Cardemail-compose-cardgaiaComponentsFreeno deps
Gauge Chartgauge-chartgaiaComponentsFree1 dep
GitHub Stars Buttongithub-stars-buttongaiaComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex