Pie Charts
Pie and donut charts for composition snapshots with optional center totals.
Pie chart gallery
Plan mix, infrastructure composition, and channel split.
Plan distribution
Infrastructure mix
Production workloads by backing service.
Channel split
New accounts by acquisition channel.
default-example.tsx
1import { CustomPieChart } from "@/registry/ui";23const data = [4 { name: "Starter", value: 275, color: "var(--chart-1)" },5 { name: "Growth", value: 200, color: "var(--chart-2)" },6 { name: "Scale", value: 187, color: "var(--chart-3)" },7 { name: "Enterprise", value: 173, color: "var(--chart-4)" },8 { name: "Free", value: 90, color: "var(--chart-5)" },9];1011export function PieChartExample() {12 return (13 <div className="mx-auto flex w-full max-w-3xl flex-col gap-6 text-left">14 <CustomPieChart15 title="Plan distribution"16 data={data}17 innerRadius={48}18 showTotalLabel19 stylePreset="signal"20 />21 <CustomPieChart22 title="Infrastructure mix"23 description="Production workloads by backing service."24 stylePreset="glass"25 data={[26 { name: "PostgreSQL", value: 45, color: "var(--chart-1)" },27 { name: "SQLite", value: 25, color: "var(--chart-2)" },28 { name: "MySQL", value: 20, color: "var(--chart-3)" },29 { name: "MongoDB", value: 10, color: "var(--chart-5)" },30 ]}31 />32 <CustomPieChart33 title="Channel split"34 description="New accounts by acquisition channel."35 innerRadius={50}36 showTotalLabel37 stylePreset="terminal"38 data={[39 { name: "Outbound", value: 45, color: "var(--chart-1)" },40 { name: "Inbound", value: 25, color: "var(--chart-2)" },41 { name: "Partnership", value: 20, color: "var(--chart-3)" },42 { name: "Community", value: 10, color: "var(--chart-5)" },43 ]}44 />45 </div>46 );47}
Installation & source
Install via the shadcn CLI or copy the registry files manually.
bash
npx shadcn@latest add @tt-ui/charts
Props
| Name | Type | Default | Description |
|---|---|---|---|
| CustomPieChart | component | - | Supports innerRadius, paddingAngle, showTotalLabel, legend visibility, and stylePreset. |