# Metric Switcher block

> Metric-switcher line chart card with clickable KPI tabs and pulsing animated dots

Platform analytics card where four KPI tabs (orders, response, revenue, users) with percent-change badges switch a single dashed line series. ReUI Frame, Badge, shadcn Button, ChartContainer, recharts LineChart. Metrics dashboard, trend chart.

- Type: Pro block
- Category: [Line Chart](https://reui.io/blocks/chart/line-chart.md)
- Page: https://reui.io/blocks/chart/line-chart/chart-6
- MCP: `get_block("chart-6")`
- Built with: Badge, Button, Frame
- Installs with a ReUI Pro or Ultimate license; setup: https://reui.io/docs/license-setup

## Best for

A row of 4 KPI toggle buttons that redraw one dashed line with pulsing points, each change computed against the prior value

## Agent notes

- Each `metrics` entry's `key` must name a column of `platformData`, since the active key becomes the `Line` `dataKey`
- Headline `value` and `prev` are typed apart from `platformData`; set `inv` on metrics where a drop is good news, as on Response
- The `XAxis` `tickFormatter` parses each ISO `date` as UTC midnight, so west of UTC every tick shows the previous day

## When not to use

- A whole call analytics page with 6 metric buttons, ranked agents and integrations: use [Voice Agent Calls](https://reui.io/blocks/application/dashboard/dashboard-4.md) (`get_block("dashboard-4")`)
- One metric studied in depth against a target, with a cohort breakdown and a changes log: use [Metric Deep Dive](https://reui.io/blocks/solutions/analytics/solution-analytics-8.md) (`get_block("solution-analytics-8")`)

## Install

```bash
npx shadcn@latest add @reui/chart-6
```

## About Line Chart blocks

### When to use

- A balance, price or revenue trend as a single stroke with period tabs and a peak marker
- Several platforms or channels compared as separate strokes on one time axis
- Two measures on different scales plotted against left and right axes

### When not to use

- A trend that needs its volume emphasized with a filled region below it: use the [Area Chart blocks](https://reui.io/blocks/chart/area-chart.md)
- Compact tiles where each figure carries a small trend of its own: use the [Sparkline blocks](https://reui.io/blocks/chart/sparkline.md)

### Agent notes

- Each stroke takes its label and color from a `chartConfig` key passed to `ChartContainer`, so add a key for every new series

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
