sigilUI

Pie Chart

A pie chart with percentage labels, colored slices, and auto-generated legend.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { PieChart } from "@sigil-ui/components";

Usage

<PieChart
  slices={[
    { label: "Direct", value: 45 },
    { label: "Organic", value: 30 },
    { label: "Referral", value: 15 },
    { label: "Social", value: 10 },
  ]}
  showLabels
  showLegend
/>

Props

PropTypeDefaultDescription
slicesPieSlice[]—Pie slices with label, value, and optional color
widthnumber220SVG width in px
heightnumber220SVG height in px
showLabelsbooleantrueShow percentage labels on slices
showLegendbooleantrueShow color legend below the chart

Token integration

CSS VariablePurpose
--s-primaryFirst slice color
--s-successSecond slice color
--s-warningThird slice color
--s-errorFourth slice color
--s-infoFifth slice color
--s-text-mutedLegend text