/
1.1k
Sponsor

Pie Chart

Unicode block pie chart with legend

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/pie-chart

Usage

import { PieChart } from "@/components/ui/pie-chart";
<PieChart
  data={[
    { label: "TypeScript", value: 45 },
    { label: "Rust", value: 25 },
    { label: "Go", value: 20 },
  ]}
  radius={6}
/>

API Reference

PieChart

PropTypeDefault
dataPieChartItem[]required
radiusnumber5
showLegendbooleantrue
showPercentagesbooleantrue

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Screen reader: Visual output exposes its meaningful value through a textual alternative or bounded accessible summary.