# Cohort Retention block

> Cohort Retention Analytics Report with Retention Curve Chart and Cohort Table

Period-over-period retention report: 4W-16W curve chart with period tabs, cohort health notes, and a sortable cohort grid by segment and event. ReUI Frame, DataGrid, Badge; shadcn Chart, Tabs, Item. For product analytics, retention, cohort views.

- 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-4
- MCP: `get_block("solution-analytics-4")`
- Built with: Avatar, Badge, Button, Chart, Data Grid, Dropdown Menu, Frame, Item, Progress, Select, Separator, Tabs, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A 4W to 16W retention curve, cohort notes under a target meter and a cohort table with retention rings and a CSV download

## Agent notes

- The `cohortRows`, `cohortNotes` and `retentionData` exports in data.ts are the sample cohorts and curves to replace
- The `handleExport` behind both Export buttons only fakes a 1.4 second spinner, while `handleExportRows` in the table is the real CSV download
- The `targetProgress` value divides week four retention by a hardcoded 61, so set your own retention target there

## When not to use

- A single metric with its own KPI rail and change timeline: use [Metric Deep Dive](https://web.dev.reui.io/blocks/solutions/analytics/solution-analytics-8.md) (`get_block("solution-analytics-8")`)
- Stage by stage conversion from signup to week 4: use [Activation Funnel](https://web.dev.reui.io/blocks/solutions/analytics/solution-analytics-3.md) (`get_block("solution-analytics-3")`)

## Third-party libraries

- Recharts v3: [API reference](https://recharts.github.io/en-US/api/), [docs](https://recharts.github.io/en-US/guide/getting-started/)
- TanStack Table v9: [API reference](https://tanstack.com/table/v9/docs/framework/react/reference/index), [docs](https://tanstack.com/table/v9/docs/framework/react/quick-start)

## Install

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

## 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.
