sigilUI

Donut Chart

A ring/donut chart for proportional data with optional center value and label.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

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

Usage

<DonutChart
  segments={[
    { label: "Direct", value: 45 },
    { label: "Organic", value: 30 },
  ]}
  centerValue="2.4K"
  centerLabel="visitors"
  thickness={24}
/>

Props

PropTypeDefaultDescription
segmentsDonutSegment[]—Ring segments with label, value, optional color
widthnumber200SVG width
heightnumber200SVG height
thicknessnumber24Ring thickness in px
centerLabelstring—Descriptive label in the center
centerValuestring—Main value displayed in the center

Token integration

CSS VariablePurpose
--s-primaryFirst segment color
--s-successSecond segment color
--s-warningThird segment color
--s-errorFourth segment color
--s-infoFifth segment color
--s-textCenter value text
--s-text-mutedCenter label text
--s-font-monoCenter value font family