Sunburst
Radial hierarchy — concentric rings where each node is an annular segment sized by value.
Category: chart · WCAG 2.1-AA · chart, sunburst, hierarchy, radial, data-viz
Props
| Prop | Type | Default | Description |
|---|---|---|---|
data | HierNode | — | Root of the tree; leaves carry value, parents sum their children. |
title | string | — | Title text for the component. |
description | string | — | Supporting description text. |
size | number | — | Square shorthand (width === height). |
width | number | — | Fixed SVG width in px. ⚠ **Omit for a responsive chart** — the chart fills and tracks its container via a ResizeObserver; there is no correct pixel number in a responsive grid. A fixed width is clamped to the container (max-inline-size: 100%) so it can never overflow its card, but it also stops the chart growing. `useChartSize` is NOT needed for this — charts call it internally. |
height | number | 300 | SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect. |
tooltip | boolean | — | Whether to show tooltips on hover. |
className | string | — | Additional CSS class names merged onto the root element. |
plain | boolean | false | When true, renders a minimal variant without chart chrome. |
Design tokens
--cascivo-chart-1--cascivo-chart-2--cascivo-chart-3--cascivo-chart-4--cascivo-chart-5--cascivo-chart-6--cascivo-chart-7--cascivo-chart-8
When to use
- Showing a part-of-whole hierarchy across multiple levels
- A radial alternative to a Treemap for nested proportions
When not to use
- A flat set of proportions — use PieChart
- Precise leaf comparison — use a Treemap or bars
Examples
Sunburst
import { Sunburst } from '@cascivo/charts'
<Sunburst
title="Disk usage"
data={{ label: 'root', children: [
{ label: 'src', children: [{ label: 'app', value: 40 }, { label: 'lib', value: 25 }] },
{ label: 'docs', value: 15 },
] }}
/>Related components
- Treemap — Use the rectilinear layout for dense leaves