Cohort Retention Matrix
Cohort retention: heat table, averages, anomalies and notes. Pro · Charts and analytics › Maps and matrices
Retention as a heat table: one row per cohort, one column per period since start, coloured by the share still active. A size-weighted average row, flags on cells unusually far from their period, notes on cohorts and cells, and arrow-key navigation with the numbers of the selected cell spelled out.
Installation
npx valyro-cli@latest login
npx valyro-cli@latest add cohort-retention-matrix
npm install valyro-ui-pro
import 'valyro-ui-pro/styles.css';
import { CohortRetentionMatrix } from 'valyro-ui-pro';
Props
| Prop | Type | Default | |
|---|---|---|---|
cohorts * | Cohort[] | Cohorts, oldest first, with active users per period. | |
periods | string[] | Column names; default labels.period(i) (M0, M1, …). | |
metric | 'percent' | 'count' | Show retention as a share or as users. | |
defaultMetric | 'percent' | 'count' | 'percent' | Initial metric when uncontrolled. Default percent. |
onMetricChange | (metric: CohortMetric) => void | Called when the reader switches the metric. | |
notes | CohortNote[] | Notes on cohorts or cells: a release, a price change, a tracking outage. | |
anomalyThreshold | number | 2 | How unusual a cell must be (in standard deviations from its period) to be flagged. Default 2. |
onCellSelect | (cohort: Cohort, period: number) => void | Called when the reader selects a cell. | |
loading | boolean | false | Data is loading: skeleton. |
error | ReactNode | Loading failed: shown instead of the table. | |
title | ReactNode | Heading. Default: labels.title. | |
headingLevel | 2 | 3 | 4 | 5 | 3 | Level of the heading (default 3). |
locale | string | BCP 47 locale for numbers; defaults to the ThemeProvider's. | |
labels | Partial<Omit<CohortRetentionMatrixLabels, 'anomalies'>> & { anomalies?: Partial<Record<CellAnomaly, string>> } | Overrides for the built-in English text; keys left out keep their defaults. |
Related components
- Heatmap — Heatmaps
- Map Chart — World map: choropleth and points, zoom and pan
- Tile Map — Lightweight tile map: markers, route, popup cards, zoom
- Line Chart — Line charts
- Bar Chart — Bar charts
- Area Chart — Filled area charts
- Scatter Chart — Scatter and bubble charts with a trend line
- Sparkline — Tiny inline charts
- Confidence Band Chart — Forecast with confidence intervals and outliers, keyboard-readable points
- Candlestick Chart — Stock candlesticks with volume and moving averages
- Donut Chart — Donut charts
- Treemap — Hierarchies as areas, with drill-down
Previous: Tile Map · Next: Flow Diagram · All Charts and analytics