ValyroUI Русская версия

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

PropTypeDefault
cohorts *Cohort[]Cohorts, oldest first, with active users per period.
periodsstring[]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) => voidCalled when the reader switches the metric.
notesCohortNote[]Notes on cohorts or cells: a release, a price change, a tracking outage.
anomalyThresholdnumber2How unusual a cell must be (in standard deviations from its period) to be flagged. Default 2.
onCellSelect(cohort: Cohort, period: number) => voidCalled when the reader selects a cell.
loadingbooleanfalseData is loading: skeleton.
errorReactNodeLoading failed: shown instead of the table.
titleReactNodeHeading. Default: labels.title.
headingLevel2 | 3 | 4 | 53Level of the heading (default 3).
localestringBCP 47 locale for numbers; defaults to the ThemeProvider's.
labelsPartial<Omit<CohortRetentionMatrixLabels, 'anomalies'>> & { anomalies?: Partial<Record<CellAnomaly, string>> }Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Tile Map · Next: Flow Diagram · All Charts and analytics