Skip to content
Twentyfirst UIHalo

Calendar View

Data · CalendarView

View as Markdown

A full calendar: day, week, month and agenda, for several calendars at once.

  • Calendars: each with a tint and a visibility toggle (hidden/onHiddenChange); readOnly calendars such as public holidays show without reply or actions.
  • Day and week: an all-day row, hours from hours (widened to fit the events), overlapping events side by side and a line at the current time.
  • Creating: click an empty slot (an hour), drag over a range (snapped to 15 minutes) or press Enter on a focused slot; onCreate gets { start, end, allDay }. Arrow keys move between slots and days, Home/End to the first and last hour.
  • Details: a popover next to the event on desktop and a sheet from the bottom on phones, with place, calendar, description, guests and their replies, "Going?" (onRsvp) and your own buttons (eventActions).
  • Phones: under 640 px a week or month shows as a list of days (the agenda).
  • Controlled: view, date, selected, hidden; onRangeChange reports the visible range (also on mount) so you can load its events.
  • Weekday and month names, times and ranges come from Intl in the provider's locale; weekStartsOn={0} starts weeks on Sunday.

Apr 13 – 19, 2026

All day

Props

CalendarView

PropTypeNotes
eventsCalendarEvent[]Required
calendars?CalendarDef[]Calendars with colour and a visibility toggle each.
hidden?string[]Ids of hidden calendars (controlled) / initially hidden / on toggle.
defaultHidden?string[]
onHiddenChange?(ids: string[]) => void
view?CalendarViewModeDay, week, month or agenda (default week). On phones a week or month shows as a list.
defaultView?CalendarViewMode
onViewChange?(view: CalendarViewMode) => void
date?DateThe day the view shows (controlled) / initially (default today).
defaultDate?Date
onDateChange?(date: Date) => void
onRangeChange?(range: { start: Date; end: Date; view: CalendarViewMode }) => voidThe visible range changed (also on mount): load its events. `end` is exclusive.
views?CalendarViewMode[]The views offered in the switcher (default all four).
onCreate?(slot: { start: Date; end: Date; allDay: boolean }) => voidClick or drag on an empty slot (or Enter on a focused slot): the new event's time.
selected?string | nullThe event whose details are open (controlled) / initially / on open and close.
defaultSelected?string | null
onSelectedChange?(id: string | null) => void
onOpenEvent?(event: CalendarEvent) => voidCalled when an event's details open.
onRsvp?(event: CalendarEvent, rsvp: CalendarRsvp) => voidYour answer from the details (Yes, Maybe, No) for events with `rsvp`.
eventActions?(event: CalendarEvent) => ReactNodeButtons at the bottom of the details (Edit, Delete, Open).
hours?[number, number]First and last hour of the day and week grid (default 7 to 21; widened to fit events).
weekStartsOn?0 | 11 = Monday (default), 0 = Sunday.
maxPerDay?numberMost events per day in the month (default 3, then "+2 more").
title?stringHeading instead of the date range.
toolbar?ReactNodeMore controls at the end of the toolbar (a "New event" button).
now?Date | string | numberWhat counts as now (default the clock), for stable tests and server rendering.
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.