ChronousDocumentation

Examples

Agenda

A flat list of days with the events under each, and empty days left out.

An agenda

Two weeks as a flat list: one row per day that has something in it, with the all-day entries above the timed ones. There is no grid here at all.

Running here

The component

Agenda.tsx
import { createCalendarComponents } from '@midstem/chronous-react'
import type { CalendarRange, EventInput } from '@midstem/chronous-react'

type EventData = { title: string }

const Calendar = createCalendarComponents<EventData>()

const RANGE: CalendarRange = {
  view: 'agenda',
  dayCount: 14,
  currentDate: '2026-03-18',
  timeZone: 'Europe/Kyiv',
}

const EVENTS: EventInput<EventData>[] = [
  {
    id: 'offsite',
    start: '2026-03-18',
    end: '2026-03-20',
    data: { title: 'Offsite' },
  },
  {
    id: 'standup',
    start: '2026-03-18T09:00',
    duration: 'PT15M',
    recurrence: { rule: 'FREQ=WEEKLY;BYDAY=MO,WE,FR' },
    data: { title: 'Standup' },
  },
  {
    id: 'review',
    start: '2026-03-19T14:00',
    end: '2026-03-19T15:30',
    data: { title: 'Design review' },
  },
]

export const Agenda = (): JSX.Element => (
  <Calendar.Root range={RANGE} events={EVENTS} locale="en-GB">
    <Calendar.AgendaList as="ul" className="m-0 p-0 list-none text-slate-200">
      <Calendar.AgendaDays
        as="li"
        className="flex gap-4 px-4 py-3 border-t border-white/10"
      >
        {({ weekdayLabel, dayLabel, monthLabel }) => (
          <>
            <span className="shrink-0 w-32 text-sm leading-5 font-semibold">
              {weekdayLabel} {dayLabel} {monthLabel}
            </span>

            <span className="flex flex-col gap-1 text-sm leading-5 text-slate-400">
              <Calendar.AgendaAllDayEvents as="span">
                {({ event }) => `${event.data?.title} · all-day`}
              </Calendar.AgendaAllDayEvents>

              <Calendar.AgendaTimedEvents as="span">
                {({ event, timeRangeLabel }) =>
                  `${event.data?.title} · ${timeRangeLabel}`
                }
              </Calendar.AgendaTimedEvents>
            </span>
          </>
        )}
      </Calendar.AgendaDays>
    </Calendar.AgendaList>
  </Calendar.Root>
)

Empty days

By default a day with nothing in it is skipped, which is what makes an agenda read as a list rather than as a calendar. Pass showEmptyDays to render the whole span instead.

Agenda.tsx
import { Calendar } from '@midstem/chronous-react'
import type { CalendarRange } from '@midstem/chronous-react'

const range: CalendarRange = {
  view: 'agenda',
  dayCount: 7,
  currentDate: '2026-03-18',
  timeZone: 'Europe/Kyiv',
}

// Every day in the span, not only the ones that have something in them.
export const Agenda = () => (
  <Calendar.Root range={range} events={[]} locale="en-GB">
    <Calendar.AgendaList as="ul" className="m-0 p-0 list-none text-slate-200">
      <Calendar.AgendaDays as="li" className="flex gap-4 px-4 py-3 border-t border-white/10" showEmptyDays>
        {({ dayLabel, monthLabel }) => (
          <span className="shrink-0 w-32 text-sm leading-5 font-semibold">
            {dayLabel} {monthLabel}
          </span>
        )}
      </Calendar.AgendaDays>
    </Calendar.AgendaList>
  </Calendar.Root>
)

timeRangeLabel is formatted in the calendar’s locale before it reaches you — the same as every other name ending in Label, as Labels describes.