Skip to content
ChartslibraryUI
Get Pro

React retention curve

One retention curve per signup cohort, newest in colour, with the size-weighted average.

Get Pro to install · $79 once<RetentionCurve />

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

When to use

  • Customer or user retention by signup month
  • Revenue retention by cohort
  • Comparing cohorts before and after a product change

When not to use

Good practice

  • Highlight the cohorts your title is about; keep the rest grey.
  • Say what 'active' means and the unit of the period.
  • Treat the last points of new cohorts with care: they are small.

Installation

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 Pro

Usage

Usage 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 Pro

Data

One 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

Props

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;
}
Pro

Cohort heatmap

Retention by cohort with incomplete cohorts left blank and a size-weighted average.

Line chart

Trends over time for one to four series, with gaps for missing data and marked forecasts.

Small multiples

One small chart per group on a shared scale, instead of a ten-colour spaghetti chart.

Sign in to ChartslibraryUI

New here? The same step creates your account.

Continue with Google
or

No password needed. Bought Pro? Use the email you paid with and your license is there. By signing in you agree to the Terms and Privacy policy.