TrainingCalendar

Full-month training view with session chips (zone-colored), nutrition compliance bars, daily TSS load bars, and plan adherence dots. Built for endurance athletes.

Preview

Usage

import { TrainingCalendar } from '@ramtt/ui'

<TrainingCalendar
  month={3}
  year={2026}
  sessions={sessions}
  nutritionOverlay
  loadOverlay
  planOverlay
  onMonthChange={(m, y) => setView({ month: m, year: y })}
  onSessionClick={(s) => openSession(s.id)}
/>

Props

PropTypeDefaultDescription
monthnumber0-indexed month (0 = January)
yearnumberFour-digit year
sessionsCalendarSession[]Session data — date, zone, duration, planned, completed, fuelScore
nutritionOverlaybooleanfalseShow 3px CHO compliance bar at the bottom of each day
loadOverlaybooleanfalseShow vertical TSS bar on the right of each day (proportional to week max)
planOverlaybooleanfalseShow filled/hollow dot in top-right (planned-completed vs planned-missed)
onMonthChange(month, year) => voidFires on ◁ ▷ navigation, arrow keys, or "T" to jump to today
onDayClick(date: Date) => voidFires when clicking the empty area of a day cell or "+N more"
onSessionClick(session) => voidFires when clicking a session chip
weekStartsOn0 | 110 = Sunday, 1 = Monday
view'month' | 'week''month'Month grid (6 rows) or single-week strip
todayDateToday reference for highlighting and past/future logic