# Metric Deep Dive block

> Single-Metric Analytics Detail Page with Target-Tracked Trend Chart

Single-metric detail page: health-badge header, four-up KPI rail, trend chart against a target line, cohort breakdown, changes timeline. ReUI Frame, Badge, Timeline; shadcn Chart, Select, Progress. For analytics dashboards, KPI tracking, metrics.

- Type: Pro block
- Category: [Analytics](https://web.dev.reui.io/blocks/solutions/analytics.md)
- Page: https://web.dev.reui.io/blocks/solutions/analytics/solution-analytics-8
- MCP: `get_block("solution-analytics-8")`
- Built with: Avatar, Badge, Breadcrumb, Button, Chart, Dropdown Menu, Frame, Progress, Select, Separator, Spinner, Timeline
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

One metric's page with a watch toggle, a 4 tile KPI rail, an alert rule footer, cohort progress bars and a timeline of edits

## Agent notes

- The `METRIC`, `KPIS`, `TREND`, `COHORTS` and `METRIC_ACTIVITY` exports in data.tsx are the sample Activation rate content to replace
- The `handleToggleWatch` and `handleRefresh` handlers only flip local state and toast with Activation rate hardcoded in the text
- The `TARGET_VALUE` constant is never read, so the trend chart draws no target line even though its description says so

## When not to use

- A compact card where 4 KPI tabs redraw a single line: use [Metric Switcher](https://web.dev.reui.io/blocks/chart/line-chart/chart-6.md) (`get_block("chart-6")`)
- Many signals scored in one backlog grid rather than one metric: use [Product Signals](https://web.dev.reui.io/blocks/solutions/analytics/solution-analytics-1.md) (`get_block("solution-analytics-1")`)

## Third-party libraries

- Recharts v3: [API reference](https://recharts.github.io/en-US/api/), [docs](https://recharts.github.io/en-US/guide/getting-started/)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/solution-analytics-8
```

## About Analytics blocks

### When to use

- Product usage reports: overall health, feature adoption, activation funnel, cohort retention or an A/B test
- Analyst workspaces for an event catalog, weekly segment rule coverage or the detail page of one metric
- Alert rule settings for product metrics: thresholds, delivery per rule and channel, and quiet hours

### When not to use

- A team home for operations work such as fulfillment, staffing, calls or payouts: use the [Dashboard blocks](https://web.dev.reui.io/blocks/application/dashboard.md)
- A single trend card placed inside a page you already built: use the [Line Chart blocks](https://web.dev.reui.io/blocks/chart/line-chart.md)
- A plain table of your own records with sorting and filters and no report around it: use [Data Grid](https://web.dev.reui.io/components/data-grid.md) (`get_component("data-grid")`)

### Agent notes

- Every block sets a `min-h-svh` wrapper plus its own max width and padding in page.tsx or its root; remove them inside your app shell
- Filters and edits live in `useState` and reset on reload; no block requests or persists data, so connect each to your analytics backend

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