Black Friday: 30% off Pro

Get 30% off

Updated

Cohort Retention

New

Preview

Customize

Color
Share
Width620px

Installation

npx shadcn@latest add https://uibrik.com/r/cohort-retention.json
Adds the files to components/uibrik/cohort-retention and installs motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/cohort-retention.

Usage

import { CohortRetention } from "@/components/uibrik/cohort-retention/cohort-retention";​<CohortRetention  title="Retention"  color="#12a594"  display="percent"  period="Week"  width={620}  // cohorts={[{ label: "…", users: 0, retention: [0] }]}  // defaultCohort={0}  // onCohortChange={(index) => {}}/>

Where to use Cohort Retention

  • Product analytics dashboards

    One grid shows whether newer cohorts stick better than older ones, without a chart per cohort.

    Pairs with Subscriber Funnel and KPI Tile

  • Growth and lifecycle reviews

    The gap to average on every cell says which launch or onboarding change moved retention.

    Pairs with Revenue Dashboard

  • SaaS investor and board updates

    A triangle that fills in reads as momentum before anyone looks at the numbers.

Props

CohortRetention
title
Type string
"Retention"
Heading above the grid.
color
Type string
"#12a594"
Hue the cells are shaded from.
display
Type "percent" | "users"
"percent"
Show shares or user counts in the cells.
period
Type string
"Week"
Name of one period, for the column heads.
width
Type number
620
Width of the card; never wider than its container.
cohorts
Type { label: string; users: number; retention: number[] }[]
–
Oldest first. retention holds the share active in period 1, 2, 3…, shorter for younger cohorts.
defaultCohort / onCohortChange
Type number / (index) => void
–
Cohort drawn in the chart on mount, and a callback when another is picked.
className
Type string
–
Classes for the wrapper.