# C box plot 1

> Salary by role — precomputed quartiles

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-box-plot-1).

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

## Install

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

## Files

### `registry/default/chart-variants/c-box-plot-1.tsx`

```tsx
"use client";

import { BoxPlot } from "@/registry/default/charts/box-plot";
import { ChartCard } from "@/registry/default/charts/chart-card";
import { formatCurrency } from "@/registry/default/lib/chart-utils";

// Precomputed salary quartiles per role.
const data = [
  {
    max: 142000,
    median: 108000,
    min: 78000,
    q1: 94000,
    q3: 121000,
    role: "Frontend",
  },
  {
    max: 168000,
    median: 124000,
    min: 86000,
    q1: 109000,
    q3: 139000,
    role: "Backend",
  },
  {
    max: 175000,
    median: 131000,
    min: 92000,
    q1: 115000,
    q3: 148000,
    role: "Platform",
  },
  {
    max: 132000,
    median: 101000,
    min: 72000,
    q1: 88000,
    q3: 114000,
    role: "Design",
  },
  {
    max: 188000,
    median: 142000,
    min: 98000,
    q1: 124000,
    q3: 160000,
    role: "Data",
  },
];

export default function SalaryByRole() {
  return (
    <ChartCard
      className="max-w-2xl"
      description="Base salary ranges by role, US offices, 2026"
      title="Salary by role"
    >
      <BoxPlot
        className="h-48"
        data={data}
        index="role"
        valueFormatter={formatCurrency}
      />
    </ChartCard>
  );
}
```
