# C delta bar 3

> Week over week — change under each metric

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-delta-bar-3).

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

## Install

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

## Files

### `registry/default/chart-variants/c-delta-bar-3.tsx`

```tsx
"use client";

import { DeltaBar } from "@/registry/default/charts/delta-bar";
import { formatPercent } from "@/registry/default/lib/chart-utils";

const metrics = [
  { change: 0.124, invert: false, name: "Signups", value: "1,046" },
  { change: -0.062, invert: false, name: "Activation", value: "38%" },
  { change: -0.21, invert: true, name: "Support tickets", value: "182" },
];

export default function WeekOverWeek() {
  return (
    <div className="grid w-full max-w-md grid-cols-3 gap-3">
      {metrics.map((m) => (
        <div className="rounded-lg border bg-card p-4" key={m.name}>
          <div className="text-muted-foreground text-xs">{m.name}</div>
          <div className="mt-1 font-semibold text-xl tabular-nums">
            {m.value}
          </div>
          <DeltaBar
            aria-label={`${m.name} ${formatPercent(m.change, { signed: true })} week over week`}
            className="mt-3"
            invertDelta={m.invert}
            value={m.change}
          />
          <div className="mt-1.5 text-muted-foreground text-xs tabular-nums">
            {formatPercent(m.change, { signed: true })} WoW
          </div>
        </div>
      ))}
    </div>
  );
}
```
