# C sankey 2

> Budget allocation — department then spend type

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

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

## Install

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

## Files

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

```tsx
"use client";

import { ChartCard } from "@/registry/default/charts/chart-card";
import { Sankey } from "@/registry/default/charts/sankey";
import { formatCurrency } from "@/registry/default/lib/chart-utils";

const data = [
  { source: "Budget", target: "Engineering", value: 4800000 },
  { source: "Budget", target: "Go-to-market", value: 3100000 },
  { source: "Budget", target: "G&A", value: 1400000 },
  { source: "Engineering", target: "Salaries", value: 3900000 },
  { source: "Engineering", target: "Cloud", value: 900000 },
  { source: "Go-to-market", target: "Salaries", value: 1900000 },
  { source: "Go-to-market", target: "Ads", value: 1200000 },
  { source: "G&A", target: "Salaries", value: 800000 },
  { source: "G&A", target: "Office", value: 600000 },
];

export default function BudgetFlow() {
  return (
    <ChartCard
      className="max-w-2xl"
      description="FY2027 budget by department, then by type of spend"
      title="Budget allocation"
      value={formatCurrency(9300000)}
    >
      <Sankey
        className="h-48"
        config={{ Budget: { color: "var(--muted-foreground)" } }}
        data={data}
        valueFormatter={formatCurrency}
      />
    </ChartCard>
  );
}
```
