Componentcharts1.07 KB gzipZero dependencies

Sunburst Chart

Two-ring sunburst chart with segment hover dimming.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add sunburst-chart

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { SunburstChart } from "@/components/ui/sunburst-chart"; <SunburstChart />

Source code

sunburst-chart.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxsunburst-chart.tsx106 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SunburstRing {  /** Slice: label, value, parent (inner ring id or null for center) */  id: string;  label: string;  value: number;  parentId: string | null;} export interface SunburstChartProps extends React.HTMLAttributes<SVGSVGElement> {  slices: SunburstRing[];  height?: number;} 

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { SunburstChart } from "@/components/ui/sunburst-chart"; <SunburstChart />
PropTypeDescription
slicesSunburstRing[]Configures slices. (Default: [])
heightnumberConfigures height. (Default: 260)