Calendar
ProAn event calendar with month, week, day, agenda, resource schedule and timeline views, in any time zone. Not an M3 component (@windmorph/react-pro).
import { Calendar, CalendarToolbar, CalendarMonthView, CalendarTimeGridView, CalendarAgendaView, CalendarTimelineView, CalendarEvent, useCalendarState } from '@windmorph/react-pro/calendar';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Purpose
An event calendar for any product: appointments, shifts, rooms, deliveries, time off. It knows nothing about the business: the app passes events and answers changes. Import it from @windmorph/react-pro/calendar, with @tanstack/react-virtual installed. To pick one date in a form, use a DatePicker.
Behaviour
- Events are absolute: a
ZonedDateTime, an ISO string with an offset, or aDate, drawn intimeZone. An all-day event takes days, and itsendis the last day, inclusive. - Slots are worked out in zoned time, so a 23 or 25-hour day is drawn correctly: a repeated hour gets its own rows, and a time a day doesn't have shows as absent.
- Pass
timeZoneandnowfor server rendering: the first render is then stable, and the current-time line appears after hydration. - Selecting, moving and resizing work by pointer, by keyboard, and on touch by long press, so scrolling is never captured. An event's menu holds the same moves on touch.
onSelectRange,onEventMoveandonEventResizemay returnfalseto reject, an adjusted value, or a promise of either. Data stays yours, so apply the change toevents.- Recurrence is the app's: pass each occurrence. Overlaps sit side by side, and
maxEventsPerDaylimits a month cell before “+N more”. viewslists what's offered, and the resource views must be listed to be used. Below 600px of its own width the default offers the day and agenda views.useCalendarStateand the exported views and toolbar compose the same pieces differently.
When not to use
To pick one date in a form, use a DatePicker.
See also
- Date picker: Pick a single date or a range on a month grid or by typing, docked below a field or in a dialog.
- Time field: A compact field that takes what people type, with the time picker a press away.