Componentcharts1.07 KB gzipZero dependencies
Sunburst Chart
Two-ring sunburst chart with segment hover dimming.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add sunburst-chartOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SunburstChart } from "@/components/ui/sunburst-chart"; <SunburstChart />Source code
sunburst-chart.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| slices | SunburstRing[] | Configures slices. (Default: []) |
| height | number | Configures height. (Default: 260) |