Donut Chart
Donut Chart shows proportional data in a ring layout with multiple panel types for labeled, stacked, and inline progress visualizations.
'use client'; import { useState } from 'react';import { DonutChartPanel } from 'sdaia-ui'; Installation
npx sdaia-ui@latest add donut-chart
Usage
import { DonutChart } from "@/components/ui/donut-chart"<DonutChart type="labeled-ring" />Examples
Labeled Ring
Donut chart with labels placed around each segment.
<DonutChartPanel variant="LabeledRing" title="Title" note="This is a note" donutHelperText="Text"Metric Ring Panel
Donut chart with a central metric displayed inside the ring.
<DonutChartPanel variant="MetricRingPanel" title="Title" donutHelperText="Text" donutLabel="422.61"Extended Metric Panel
Donut chart with an extended panel showing additional metric details.
<DonutChartPanel variant="ExtendedMetricPanel" title="Title" note="This is a note" dateBadge="26/02/2026"API Reference
DonutChartProps
Props for the DonutChart component.
Prop | Type | Default | Required |
|---|---|---|---|
variant | 'Color Border' | 'Color Filled' | 'Color Border' | optional |
pie | boolean | false | optional |
percentage | number | 50 | optional |
slices | 2 | 3 | 4 | 5 | 6 | 3 | optional |
sliceData | DonutChartSliceData[] | - | optional |
helperText | string | 'Text' | optional |
label | string | - | optional |
size | number | 176 | optional |
segmentGap | number | 3 | optional |
rtl | boolean | false | optional |