Cohort heatmap
Retention by cohort with incomplete cohorts left blank and a size-weighted average.
One retention curve per signup cohort, newest in colour, with the size-weighted average.
A retention curve shows what share of a signup cohort is still active one, two, three months later. Drawing one curve per cohort answers the question every SaaS board asks: are newer customers sticking around better than older ones?
The chart takes the same data as the cohort heatmap: a cohort name, its starting size and the retention values by period. The newest cohorts with enough history are drawn in colour and the rest in grey, so the eye goes to the change; pass highlight to pick others. A size-weighted average curve shows the typical shape, drawn only while at least two cohorts have reached that period. If you pass counts instead of shares, each cohort is divided by its first value and a note says so.
Use it to see where the curve flattens and whether that point moves. For exact numbers per cohort and month, use the cohort heatmap.
Read the guide: shadcn Cohort Chart: Retention Heatmap or Curves, and How to Install One
Retention curve is a Pro chart.
Installation is part of Pro
Get Pro to install it with your access key and the shadcn CLI, and use it in unlimited projects.
Unlock with ProUsage examples are part of Pro
Every example on this page comes with its code in Pro. The props and data shape below are public.
Unlock with ProOne row per cohort (oldest first) with a cohort name, an optional starting size and an array of retention values by period.
[{ cohort: "Jan 25", size: 320, values: [1, 0.78, 0.72, null] }, ...]Missing values are null. Invalid values make the chart say what’s wrong instead of drawing a misleading picture. How charts handle bad data
Every chart also accepts the shared frame props: title, subtitle, source, height, mode, toolbar. Common API
export interface RetentionCurveProps extends FrameProps {
/** One row per cohort, oldest first. Same shape as the cohort heatmap. See the Data section. */
data: RetentionCohort[];
/** Number format for the y axis. Default "percent". */
format?: FormatInput;
/** Prefix for the period labels on the x axis. Default "M" (M0, M1, ...). */
periodPrefix?: string;
/** Cohorts to draw in colour. Default: the 3 newest cohorts with at least 3 periods. The rest are grey. */
highlight?: string[];
/** Draw the size-weighted average curve. Default true. */
average?: boolean;
/** Text for the average curve. Default "Average". */
averageLabel?: string;
}Retention by cohort with incomplete cohorts left blank and a size-weighted average.
Trends over time for one to four series, with gaps for missing data and marked forecasts.
One small chart per group on a shared scale, instead of a ten-colour spaghetti chart.