Get started
Core concepts
Four ideas explain the whole component: events are controlled, the view prop picks what renders, navigation is internal but observable, and every change passes a before and an after callback.
Events are controlled
data is yours. ProScheduler reads it, lays it out and never writes to it. When a user moves, resizes, creates or deletes an event, the scheduler describes the change in a callback, and your state update is what makes it happen on screen. That keeps one source of truth — the array you also send to your server — and makes undo, optimistic updates and collaboration a matter of ordinary React state.
type SchedulerEvent = {
id?: string | number
title: string
start: Date | string | number // ISO string and epoch ms are accepted
end?: Date | string | number // omit for a point-in-time event
resource?: string | number // the row or column it belongs to
color?: string // falls back to the resource's colour
allDay?: boolean
editable?: boolean // false locks move and resize
[key: string]: unknown // your own fields travel with it
}Extra keys are preserved: the event you receive in a callback is your object with new start, end and resource values spread over it.
The view prop
view has one key per view type — timeline, scheduler, agenda, calendar — each holding that view’s options. With more than one, the default header shows a switcher; defaultView picks the one to open on, otherwise the first present key in the order calendar, timeline, scheduler, agenda. The one special case: calendar and agenda together render as a single layout, the agenda listing the day picked in the grid.
// One view…
view={{ timeline: { type: "month" } }}
// …or several, with a switcher in the header
view={{
scheduler: { type: "week", startTime: "08:00", endTime: "18:00" },
timeline: { type: "month" },
agenda: { type: "month" },
}}
// A month grid with the selected day's events listed below it
view={{ calendar: { type: "month" }, agenda: { type: "day" } }}Every view also has a type — the span it shows: a day, a week, a month or a year. The header’s length selector changes it at runtime without touching your view object. Views covers each one.
Before and after callbacks
Each change has two callbacks. The before one — onEventCreate, onEventUpdate, onEventDelete — may return false to cancel: a moved event snaps back to where it was. Otherwise the after one — onEventCreated, onEventUpdated, onEventDeleted — fires with the final event.
<ProScheduler
data={events}
view={view}
// Before: return false to cancel. The event snaps back; nothing else fires.
onEventUpdate={(event) => canEdit(event)}
// After: the change is final. Apply it to your state (and your API).
onEventUpdated={(event) => save(event)}
/>| User action | Before | After |
|---|---|---|
| Drag an event, or resize it | onEventUpdate | onEventUpdated |
| Drag on empty space (or click, with clickToCreate) | onEventCreate | onEventCreated |
| Save in the built-in editor | onEventCreate / onEventUpdate | onEventCreated / onEventUpdated |
| Delete in the built-in editor | onEventDelete | onEventDeleted |
Navigation
The visible date, the selected day and the active view are the scheduler’s own state, so prev, next and today work with no wiring. refDate and selectedDate steer it — set them and the view moves, on mount or any time later — while onSelectedDateChange reports the user’s own navigation and onPageChange reports the range now on screen. The ref’s navigate() works too.
const [date, setDate] = useState(new Date(2026, 9, 1))
<ProScheduler
selectedDate={date} // change it and the view follows
onSelectedDateChange={setDate} // the user's own navigation, reported back
onPageChange={({ firstDay, lastDay }) => load(firstDay, lastDay)}
…
/>