UI

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

Cloud spend, September

All teams, $96,840

Cloud spend, September
PathValueShare of parent
Platform$35,74036.9%
Platform / Compute$27,07075.7%
Platform / Compute / API cluster$18,91069.9%
Platform / Compute / Batch workers$8,16030.1%
Platform / Storage$8,67024.3%
Data$34,30035.4%
Data / Warehouse$24,50071.4%
Data / Pipelines$9,80028.6%
Product$18,60019.2%
Product / Web edge$11,20060.2%
Product / Search$7,40039.8%
Security$8,2008.5%
Security / Audit logs$5,30064.6%
Security / Secrets$2,90035.4%
Loading interactive preview…

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.

Storage by cluster

Platform, 915 GB

Storage by cluster
PathValueShare of parent
Platform915 GB49.6%
Platform / Compute605 GB66.1%
Platform / Compute / Containers420 GB69.4%
Platform / Compute / Build cache185 GB30.6%
Platform / Snapshots310 GB33.9%
Analytics930 GB50.4%
Analytics / Warehouse640 GB68.8%
Analytics / Event logs290 GB31.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.

ArgumentType / defaultDescription
labelstringDefault: "Sunburst chart"Names the chart for assistive technology and captions the data table. Shown as the figure heading only when title is omitted.
titlestring—Optional visible figure title above the breadcrumb navigation.
descriptionstring—One or two sentences on what the chart shows, below the title; omit it when the title says enough.
dataSunburstNodeDefault: {"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.
depthintegerDefault: 3Rings shown around the center at once (1–5). Shallower branches automatically re-share the full radius.
sizeintegerDefault: 340Largest ring diameter in pixels (180–640). Scales down to fit narrower containers.
defaultFocusstring—Initial zoomed node ID when uncontrolled. Defaults to the root node; later argument edits do not reset a mounted instance.
legendbooleanDefault: trueList the children of the centered node with values and shares, kept in sync with arc hover and focus.
unitstring—Optional unit suffix appended after formatted values, such as "GB" or "ms".
valueFormatNumberFormat—How values appear in the tooltip, table and axis: decimal, percent or currency, with fraction digits. Axis ticks are compacted (12.9K).
emptyLabelstringDefault: "No data yet"Shown in the center when the root total is zero.
tableTogglebooleanDefault: falseShow a button that reveals the data table. The table is always available to assistive technology.
tableLabelstringDefault: "Data table"Name of the data table button.
localestring—BCP 47 locale for numbers and dates. Omit it to inherit the application locale (en-US by default).
recipestudio | softDefault: "studio"Visual treatment. Both recipes use the same interaction behavior.
themeSunburstTheme—Color mode, accent, and semantic tokens including the chart palette. See Theming.
motionnone | subtle | expressiveDefault: "subtle"Draw-in and zoom animation preset. System reduced-motion preferences take precedence.
motionOptionsSunburstMotionOptions—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.
dirltr | rtl—Reading direction for the breadcrumb, tooltip, and legend. Omit to inherit the page direction.

React integration

PropPurpose
focusControlled ID of the node currently centered in the ring
onFocusChangeFires with the new centered node ID on zoom, in both modes
formatValueCustom formatter (value: number) => string for center, legend, and table
presetApplication defaults, overridden by explicit instance props
tokensCSS variables applied after the typed theme
refRef forwarded to the root <figure>
className, styleApplied to the root <figure>
Native attributesid, data-*, and remaining <figure> attributes forwarded to the root

Keyboard & accessibility

KeyInteraction
TabMove through breadcrumb buttons, the sunburst ring, and legend rows
ArrowLeft, ArrowRightMove to the previous or next sibling segment, wrapping
ArrowDown, ArrowUpMove to the first visible child segment or back to its parent segment
Home, EndJump to the first or last sibling segment
Enter, SpaceZoom into the focused branch segment and focus its first child
Escape, BackspaceZoom 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": []
}

On this page