# C treemap 2

> Bundle size — flat list of packages

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-treemap-2).

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

## Install

```bash
npx shadcn@latest add https://shadcn.exchange/r/cnippet/c-treemap-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/treemap`, `@cnippet/chart-card`

## Files

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

```tsx
"use client";

import { ChartCard } from "@/registry/default/charts/chart-card";
import { Treemap } from "@/registry/default/charts/treemap";

const kb = (value: number) =>
  value >= 1000 ? `${(value / 1000).toFixed(1)} MB` : `${value} KB`;

const data = [
  { name: "react-dom", value: 132 },
  { name: "recharts", value: 98 },
  { name: "app code", value: 86 },
  { name: "motion", value: 54 },
  { name: "date-fns", value: 23 },
  { name: "zod", value: 14 },
  { name: "lucide", value: 11 },
];

export default function BundleSize() {
  return (
    <ChartCard
      className="max-w-2xl"
      description="Gzipped size of the main client bundle, by package"
      title="Bundle size"
      value={kb(418)}
    >
      <Treemap className="h-48" data={data} valueFormatter={kb} />
    </ChartCard>
  );
}
```
