Cohort retentionPro
Retention by signup month as a heatmap, with segments.
What's inside
- Heatmap with row/column tracking
- Segment switcher
- Month 1, 6 and 11 averages
When to use
- Product and growth teams checking whether newer cohorts retain better.
When not to use
- Fewer than three cohorts: show a line chart.
Installation
Usage
Import it from @/components/blocks/cohort-retention after installing. It ships with sample data, so it renders straight away; swap in your own data when you're ready.
import { CohortRetention } from "@/components/blocks/cohort-retention";
export default function Page() {
return (
<main className="mx-auto max-w-6xl p-6">
<CohortRetention />
</main>
);
}API reference
CohortRetention
Retention by signup month as a heatmap with a segment switcher and month 1, 6 and 11 averages. Also the default export. No props: sample data sits at the top of the file, ready to swap for your own.
No props.
Keyboard interactions
| Keys | Action |
|---|---|
| Tab | Reach the segment control |
| ←or→ | Change segment |
Accessibility
- The heatmap is a real table with headers; every cell prints its percentage.
Motion
- Cells pop in along the diagonal and re-color when the segment changes.
Responsive behavior
- The table scrolls horizontally inside the card on phones; the cohort column stays sticky.
Performance
- Sample data is plain arrays at the top of the file. Replace them with your API data and keep the shapes.
Notes for AI
- Use null for months that haven't happened yet so cells stay empty.
This page as Markdown, for assistants and coding agents:
/blocks/cohort-retention/markdownThe full library index for assistants is at /llms.txt.
Lode222 doc pagesllms.txt