# C sunburst chart 2

> Disk usage — folders and subfolders

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/?utm_source=shadcn.exchange) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/c-sunburst-chart-2).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/c-sunburst-chart-2
- Screenshot: https://shadcn.exchange/shot/cnippet/c-sunburst-chart-2/light.png
- Registry item: https://ui.cnippet.dev/r/c-sunburst-chart-2.json
- Categories: sunburst chart
- Listed: 2026-10-27, source last changed 2026-10-27

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet/c-sunburst-chart-2.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/sunburst-chart`, `@cnippet/chart-card`

## Files

### `registry/default/chart-variants/c-sunburst-chart-2.tsx`

```tsx
"use client";

import { ChartCard } from "@/registry/default/charts/chart-card";
import { SunburstChart } from "@/registry/default/charts/sunburst-chart";

// GB per folder and its largest subfolders.
const data = [
  {
    children: [
      { name: "node_modules", value: 38.2 },
      { name: "builds", value: 12.6 },
      { name: "src", value: 1.4 },
    ],
    name: "Projects",
  },
  {
    children: [
      { name: "Photos", value: 64.1 },
      { name: "Videos", value: 41.8 },
    ],
    name: "Media",
  },
  {
    children: [
      { name: "Docker images", value: 22.4 },
      { name: "VMs", value: 30.2 },
    ],
    name: "Containers",
  },
  { name: "System", value: 18.9 },
];

export default function DiskUsage() {
  return (
    <ChartCard
      className="max-w-sm"
      description="229.6 GB used, by folder"
      title="Disk usage"
    >
      <SunburstChart
        className="h-64"
        data={data}
        valueFormatter={(value) => `${value.toFixed(1)} GB`}
      />
    </ChartCard>
  );
}
```
