Klar

Charts / React science and statistics charts / Statistics

Kaplan–Meier survival

Survival curves with confidence bands, censor ticks, median guides, a log-rank test and the numbers at risk aligned under the time axis.

React component KaplanMeier, data through props. Uncertainty made visible: fits, intervals, survival and effect sizes. Tags: kaplan-meier, survival, step-line, confidence-interval, clinical, censoring, log-rank.

Install

npm i klar-charts

import 'klar-charts/styles.css'
import { ThemeScope, KaplanMeier } from 'klar-charts'

# or copy the source:
npx shadcn@latest add https://klar.run/r/sci-kaplan-meier.json

Usage

<KaplanMeier arms={survivalArms} height={540} xMax={48} tickEvery={6} showCI={ci === 'on'} />

Related kaplan–meier survival charts