Sunburst
Concentric rings for hierarchical part-to-whole data with drill-down zoom, breadcrumb navigation, and a rolling center total.
import { Sunburst } from '@uthereal/ui/sunburst'Sunburst playground
All teams, $96,840
| Path | Value | Share of parent |
|---|---|---|
| Platform | $35,740 | 36.9% |
| Platform / Compute | $27,070 | 75.7% |
| Platform / Compute / API cluster | $18,910 | 69.9% |
| Platform / Compute / Batch workers | $8,160 | 30.1% |
| Platform / Storage | $8,670 | 24.3% |
| Data | $34,300 | 35.4% |
| Data / Warehouse | $24,500 | 71.4% |
| Data / Pipelines | $9,800 | 28.6% |
| Product | $18,600 | 19.2% |
| Product / Web edge | $11,200 | 60.2% |
| Product / Search | $7,400 | 39.8% |
| Security | $8,200 | 8.5% |
| Security / Audit logs | $5,300 | 64.6% |
| Security / Secrets | $2,900 | 35.4% |
Overview
A sunburst displays a multi-level hierarchy of parts as concentric rings sized by share. Clicking a segment, a legend row, or a breadcrumb swings every arc around the focused node as the new center. Shallower subtrees automatically expand to fill the full radius, the breadcrumb updates to trace the path back out, and the center displays the rolling total and share. Hovering or focusing a segment highlights its full lineage, dims unrelated branches, and tracks a tooltip with its path, formatted value, and shares of both its parent and the whole. A native data table lists every node and path.
Use a sunburst to explore two to four levels of hierarchical shares such as cloud spend, storage, or headcount. For a single level of parts, use a donut chart. For nested rectangular tiles showing two levels at once, use a treemap. For exact comparisons across flat categories, use a bar chart.
Usage
import { Sunburst } from '@uthereal/ui/sunburst'
const spend = {
id: 'all',
label: 'All teams',
children: [
{
id: 'platform',
label: 'Platform',
children: [
{
id: 'platform-compute',
label: 'Compute',
children: [
{ id: 'api-cluster', label: 'API cluster', value: 18910 },
{ id: 'batch-workers', label: 'Batch workers', value: 8160 },
],
},
{ id: 'platform-storage', label: 'Storage', value: 8670 },
],
},
{
id: 'data',
label: 'Data',
children: [{ id: 'data-warehouse', label: 'Warehouse', value: 31020 }],
},
],
}
export function CloudSpend() {
return (
<Sunburst
data={spend}
label="Cloud spend, September"
valueFormat={{
style: 'currency',
currency: 'USD',
maximumFractionDigits: 0,
}}
onFocusChange={(id) => console.log(id)}
/>
)
}Leaves carry a nonnegative value; branches carry children and sum their descendants. Trees support up to 300 nodes and six nesting levels below the root, with unique id values across the tree so data updates morph existing arcs. Pass focus and onFocusChange to control the centered branch externally, or pass formatValue for custom number formatting.
Examples
Pre-zoomed branch with unit suffix
Set defaultFocus to open directly on a specific branch ID, displaying its ancestor trail in the breadcrumb and expanding shallower levels across the full ring radius. Set unit to append a unit label after formatted values.
Platform, 915 GB
| Path | Value | Share of parent |
|---|---|---|
| Platform | 915 GB | 49.6% |
| Platform / Compute | 605 GB | 66.1% |
| Platform / Compute / Containers | 420 GB | 69.4% |
| Platform / Compute / Build cache | 185 GB | 30.6% |
| Platform / Snapshots | 310 GB | 33.9% |
| Analytics | 930 GB | 50.4% |
| Analytics / Warehouse | 640 GB | 68.8% |
| Analytics / Event logs | 290 GB | 31.2% |
Behavior
Rings partition the full circle proportionally with parallel 2 px gaps between adjacent segments. The first four top-level branches take categorical series hues (--ui-series-1 through --ui-series-4), and descendants step lighter toward the surface at each level; branches beyond four fall back to neutral ink. Arc labels follow the tangent of their ring, flip upright on the lower half, stay 11 px on screen as the ring scales, and appear only when the arc has enough arc length and thickness.
Clicking a branch zooms into it; clicking a leaf in an outer ring zooms to its parent branch; clicking the center button zooms out one level. The synced legend lists the direct children of the current center, sitting beside the ring on wide containers and stacking below it below 560 px. When the root total is zero, the ring renders its track and displays emptyLabel ("No data yet") in the center.
API reference
These serializable arguments and defaults come directly from the component schema.
| Argument | Type / default | Description |
|---|---|---|
label | stringDefault: "Sunburst chart" | Names the chart for assistive technology and captions the data table. Shown as the figure heading only when title is omitted. |
title | string— | Optional visible figure title above the breadcrumb navigation. |
description | string— | One or two sentences on what the chart shows, below the title; omit it when the title says enough. |
data | SunburstNodeDefault: {"id":"all","label":"All teams","children":[{"id":"platform","label":"Platform","children":[{"id":"platform-compute","label":"Compute","children":[{"id":"api-cluster","label":"API cluster","value":18910},{"id":"batch-workers","label":"Batch workers","value":8160}]},{"id":"platform-storage","label":"Storage","value":8670}]},{"id":"data","label":"Data","children":[{"id":"data-warehouse","label":"Warehouse","value":24500},{"id":"data-pipelines","label":"Pipelines","value":9800}]},{"id":"product","label":"Product","children":[{"id":"product-web","label":"Web edge","value":11200},{"id":"product-search","label":"Search","value":7400}]},{"id":"security","label":"Security","children":[{"id":"security-audit","label":"Audit logs","value":5300},{"id":"security-secrets","label":"Secrets","value":2900}]}]} | Root hierarchy node with id, label, optional leaf value (zero or more), and optional children (a branch sums its descendants). Supports up to 300 nodes and 6 nesting levels below the root. |
depth | integerDefault: 3 | Rings shown around the center at once (1–5). Shallower branches automatically re-share the full radius. |
size | integerDefault: 340 | Largest ring diameter in pixels (180–640). Scales down to fit narrower containers. |
defaultFocus | string— | Initial zoomed node ID when uncontrolled. Defaults to the root node; later argument edits do not reset a mounted instance. |
legend | booleanDefault: true | List the children of the centered node with values and shares, kept in sync with arc hover and focus. |
unit | string— | Optional unit suffix appended after formatted values, such as "GB" or "ms". |
valueFormat | NumberFormat— | How values appear in the tooltip, table and axis: decimal, percent or currency, with fraction digits. Axis ticks are compacted (12.9K). |
emptyLabel | stringDefault: "No data yet" | Shown in the center when the root total is zero. |
tableToggle | booleanDefault: false | Show a button that reveals the data table. The table is always available to assistive technology. |
tableLabel | stringDefault: "Data table" | Name of the data table button. |
locale | string— | BCP 47 locale for numbers and dates. Omit it to inherit the application locale (en-US by default). |
recipe | studio | softDefault: "studio" | Visual treatment. Both recipes use the same interaction behavior. |
theme | SunburstTheme— | Color mode, accent, and semantic tokens including the chart palette. See Theming. |
motion | none | subtle | expressiveDefault: "subtle" | Draw-in and zoom animation preset. System reduced-motion preferences take precedence. |
motionOptions | SunburstMotionOptions— | draw (initial radial sweep-in at 30% in view; 900 ms spring by default) and morph (zoom and data transitions; 620 ms spring by default): a tween with duration (ms) or a spring. |
dir | ltr | rtl— | Reading direction for the breadcrumb, tooltip, and legend. Omit to inherit the page direction. |
React integration
| Prop | Purpose |
|---|---|
focus | Controlled ID of the node currently centered in the ring |
onFocusChange | Fires with the new centered node ID on zoom, in both modes |
formatValue | Custom formatter (value: number) => string for center, legend, and table |
preset | Application defaults, overridden by explicit instance props |
tokens | CSS variables applied after the typed theme |
ref | Ref forwarded to the root <figure> |
className, style | Applied to the root <figure> |
| Native attributes | id, data-*, and remaining <figure> attributes forwarded to the root |
Keyboard & accessibility
| Key | Interaction |
|---|---|
Tab | Move through breadcrumb buttons, the sunburst ring, and legend rows |
ArrowLeft, ArrowRight | Move to the previous or next sibling segment, wrapping |
ArrowDown, ArrowUp | Move to the first visible child segment or back to its parent segment |
Home, End | Jump to the first or last sibling segment |
Enter, Space | Zoom into the focused branch segment and focus its first child |
Escape, Backspace | Zoom out one level to the parent branch, or clear active focus at root |
The chart renders a <figure> named by title (or label when title is omitted) and linked via aria-details to a native data table listing every node's full path, value, and share of its parent. The breadcrumb renders a <nav> landmark with aria-current="location" on the current level. Legend rows are native buttons naming each child's path, value, parent share, and whether activation zooms in.
The ring is a single focusable group (aria-roledescription="sunburst"). Moving keyboard focus across segments updates a polite role="status" live region with the active path, formatted value, and share of parent. Individual SVG arcs are hidden from assistive technology. Layout properties are logical for RTL reading order, and high-contrast strokes and borders apply under forced-colors: active.
Motion and theming
When 30% of the figure enters the viewport, arcs sweep in clockwise on a 900 ms spring (motionOptions.draw); server-rendered markup is final. Zooming or updating data interpolates every arc's start angle, end angle, ring depth, and visible ring count on a single 620 ms spring (motionOptions.morph, bounce 0.06), painted imperatively without re-rendering React each frame. Center values roll digit by digit, center labels rise out of a soft blur, tooltips follow on a snappy spring, and breadcrumbs and stacked legends reflow smoothly. Under prefers-reduced-motion: reduce, arcs jump to their final positions and text crossfades briefly. Under motion="none", all transitions and animations are immediate.
theme accepts a mode, an accent, and semantic tokens including the chart palette and display font family. An application-wide UtherealProvider supplies defaults.
Composition
In an agent composition, Sunburst is a leaf with no actions. The zoomed node ID is host state stored at /components/instance-<id>/focus, initialized from defaultFocus (or data.id when omitted). The host updates data through composition updates. See Building with agents.
{
"type": "Sunburst",
"props": {
"label": "Cloud spend",
"data": {
"id": "all",
"label": "All teams",
"children": [
{ "id": "platform", "label": "Platform", "value": 35740 },
{ "id": "data", "label": "Data", "value": 31020 }
]
}
},
"children": []
}