Skip to content
satin

Donut chart

How a total splits into a few parts, as a ring with the sum in the middle.

Revenue by channel

Oct 26 – Nov 1, 2026

€47,290Total revenue
  • Dine-in
  • Delivery apps
  • Takeaway
  • Catering

Installation

Terminal
npm i @uisatin/ui
Import
import { DonutCard } from '@uisatin/ui/donut-chart'

About 48.6 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The DonutCard component is a wrapper around the div element with the title and a period Select, the range, a ring with the sum in the middle and a legend pill per part. Hovering a part or its pill brings it forward and shows its value and share in the middle.

PropTypeDefault
title
string
—
range
string
—
data
ChartDatum[]
—
centerLabel
string
"Total"
periods
string[]string[][]
—
value
string
—
onPeriodChange
(period) => void
—
formatValue
(value) => string
—
highlight
number
—

Accessibility

The card is role="figure" labelled by its title. The ring is hidden. The legend is a list named after the title; each pill is a tab stop named "label: value, share%". The middle of the ring is a polite live region, so moving to a part reads its value and share.

KeyAction
TaborShift+TabMoves from part to part and shows its value in the middle.