ProSchedulerSign in

API reference

ProScheduler props

The complete component surface, grouped by responsibility, followed by the options of each view and the imperative handle. Types mirror the package’s exported TypeScript definitions.

Imports

import {
  ProScheduler,
  type ProSchedulerProps,
  type ProSchedulerInstance,
  type SchedulerEvent,
  type SchedulerResource,
  type SchedulerView,
} from "@andreisaac/pro-scheduler"

// Types and locales, without the client boundary:
import { localeDe, type SchedulerEvent } from "@andreisaac/pro-scheduler/server"

Data

What is scheduled, and on what. The scheduler reads these and never writes to them.

PropTypeDefaultDescription
dataRequiredSchedulerEventInput[]—The events to show. Controlled: apply the changes reported by the callbacks to update it.
resourcesSchedulerResource[][]Rows of the timeline (or columns of the time grid with view.scheduler.resources), colours for their events, and options in the built-in editor. A resource with children is a collapsible group; see Resources for every field.
viewRequiredSchedulerView—Which views to configure and their options. Several keys add a switcher to the header.
defaultViewSchedulerViewTypefirst presentThe view to open on. Without it, the first present key in the order calendar, timeline, scheduler, agenda opens.
eventDensity"dense"—Enable capped, virtualized defaults: three timeline lanes and an automatic time-grid stack cap. Explicit view options take precedence; overflow retains access to hidden events.

Interaction

Which gestures are allowed and what they snap to.

PropTypeDefaultDescription
dragToMovebooleantrueDrag events to another time (and resource, in the timeline).
dragToResizebooleantrueDrag an event’s edge to change its start or end.
dragToCreatebooleantrueDrag across empty space to draft a new event.
clickToCreatebooleanfalseA single click on empty space drafts a new event (one hour in the time grid, one cell in the timeline). Without it a click only fires onCellClick.
dragBetweenResourcesbooleantrueAllow timeline events to change rows.
eventDeletebooleantrueOffer Delete in the built-in editor.
dragTimeStepnumber30Minutes that move, resize and create snap to, when the active view does not set its own.
showDefaultEditorbooleantrueOpen the built-in create/edit dialog. When false, creation goes straight to onEventCreate and clicks only fire onEventClick.
extendDefaultEvent(draft: EventDraft) => Partial<SchedulerEvent>—Default fields merged into every event created through the UI.

Rules and backgrounds

Checked before any callback; a refused change snaps back and reports why.

PropTypeDefaultDescription
invalidPschInvalid[]—Blocked spans — absolute, whole days, or daily/weekly clock-time windows, optionally per resource. Nothing can be created, moved or resized into one.
colorsPschColor[]—Shaded spans in the same shape, with background, cssClass, textColor and title. Visual only.
eventOverlapbooleantruefalse refuses any change that overlaps another event of the same resource, buffers included.
validationHorizon{ start: DateInput; end: DateInput }current pageFinite half-open window for validated commits, including loaded conflicts beyond the page. Unbounded series are checked within this window; the host owns final validation.
onValidationCoverage(coverage: PschValidationCoverage) => void—Reports finite loading ranges visited, including a first-day range for off-page inputs. recurrenceLimits identifies windows made incomplete by recurrence work limits.
onRecurrenceLimit(diagnostic: PschRecurrenceDiagnostic) => void—Reports a complex recurrence's 200,000-period work limit. Simple daily and weekly counted rules fast-forward without that history scan.
onEventCreateFailed(failure: PschValidationFailure) => void—A create was refused: { event, reason: "invalid" | "overlap" | "permission", inputError?, invalid?, overlapping? }. Invalid input dates, reversed ends and buffers include inputError.
onEventUpdateFailed(failure: PschValidationFailure) => void—A move, resize or edit was refused; the event snapped back.

Callbacks

Before-callbacks may return false to cancel; after-callbacks report the final event.

PropTypeDefaultDescription
onEventCreate(draft: EventDraft) => boolean | void—A new event is about to be created. Return false to cancel.
onEventCreated(event, info?) => void—A new event was created (or split off a series; then it has no id). Add it to data.
onEventUpdate(event, info?) => boolean | void—An event is about to move, resize or be edited — for an occurrence, the occurrence as changed. Return false and it snaps back.
onEventUpdated(event, info?) => void—The updated event — your object with new start, end and resource (or a series with a new exception or end). Replace it in data.
eventChangeDelivery"events" | "transaction""events"Choose ordered per-event notifications or one transaction notification. Transaction mode preserves before-hooks and suppresses the three per-event persistence callbacks.
onEventTransaction(change: PschEventTransaction, info?, context?) => void—Receives { created, updated, deleted } once per accepted operation or validated creation batch when transaction delivery is enabled. Apply the complete batch to controlled data and persistence.
onEventDelete(event, info?) => boolean | void—An event is about to be deleted. Return false to keep it.
onEventDeleted(event, info?) => void—An event was deleted. Remove it from data. info ({ mode, occurrence, originEvent }) is set when the change came from an occurrence.
onEventClick(event: SchedulerEvent) => void—An event was clicked (never fired by the click that ends a drag).
onEventDoubleClick(event: SchedulerEvent) => void—An event was double-clicked. onEventClick fires too; debounce if you need to tell them apart.
onCellClick({ date, resource }) => void—Empty space was clicked, with the date (and resource) under the pointer.
onCellHoverIn({ date, resource }) => void—The pointer entered an empty cell (a timeCellStep slot, or a timeline column of a row). Fires once per cell.
onCellHoverOut({ date, resource }) => void—The pointer left the cell last reported by onCellHoverIn.
onResourceCollapse(resource, collapsed: boolean) => void—A resource group was expanded or collapsed (timeline).

Rendering

Replace parts of the UI; everything not replaced keeps its default.

PropTypeDefaultDescription
renderHeader() => ReactNodedefault headerThe navigation bar. Compose it from CalendarNav, CalendarPrev, CalendarNext, CalendarToday, ViewSwitcher, ViewLengthSelect and ZoomControl, or read useScheduler().
renderEventContent(data: PschCalendarEventData) => ReactNode—The inside of every event, keeping the default block, colour and handles.
renderEvent(data: PschCalendarEventData) => ReactNode—The whole event element in every view.
renderTimelineEvent(data: PschCalendarEventData) => ReactNoderenderEventThe whole event element, timeline only.
renderSchedulerEvent(data: PschCalendarEventData) => ReactNoderenderEventThe whole event element, time grid only.
renderAgendaEvent(data: PschCalendarEventData) => ReactNoderenderEventThe whole list item, agenda only.
renderResource(resource: SchedulerResource) => ReactNodethe nameThe content of each timeline row’s label cell.
renderResourceHeader() => ReactNode“Resources”The heading above the resource column.
renderSidebar(resource: SchedulerResource) => ReactNode—Timeline: a right-hand column with a cell per row.
renderSidebarHeader() => ReactNode—Timeline: the heading above the right-hand column.
renderDayFooter({ date, events }) => ReactNode—Timeline: a cell under each axis column; events are those overlapping it, across all rows.
renderResourceFooter() => ReactNode—Timeline: the bottom-left corner under the resource column. The footer strip shows when this or renderDayFooter is set.
renderDay({ date }) => ReactNode—Day headings in the time grid and timeline, and day cells in the calendar. renderHour, renderWeek, renderMonth and renderYear are aliases.
renderEventTooltip(data: PschCalendarEventData) => ReactNodetitle and timeThe hover card on events in the time grid and timeline. Return null for none on that event.
showEventTooltipbooleantruefalse turns every event tooltip off.
renderAgendaDay({ date, events, isToday }) => ReactNodeweekday and dateAgenda: each day's heading.
renderAgendaEmpty() => ReactNode"No events"Agenda: what an empty page shows.
recurringEditMode"ask" | "current" | "following" | "all""ask"What an edit or delete of one occurrence applies to; "ask" prompts.
dataTimezonestring (IANA)browserZone that floating times in data (no offset) are read in, and that series repeat in.
displayTimezonestring (IANA)browserZone every view shows times in; today and the current-time line follow it.
dir"ltr" | "rtl" | "auto""auto"Text direction; "rtl" mirrors every view. "auto" follows the page.
min / maxDateInput—Bounds for navigation and editing; time outside is blocked. max is inclusive (a midnight date includes that day).
onVirtualLoading({ startIndex, endIndex, resources, firstDay, lastDay }) => void—Timeline: the rendered rows and dates changed — load their events, or more resources near the end.
selectMultipleEventsbooleanfalseClicks select events (double click edits); Delete removes the selection, Escape clears it.
selectedEventsSchedulerEvent[]—The selection, controlled.
dragSelectedEventsbooleanfalseWith selectMultipleEvents, drag a selected group back-to-back in time grids and timed timelines. Whole-group validation; recurring edits affect selected occurrences only.
onSelectedEventsChange(events) => void—The selection changed.
onEventsDelete(events) => boolean | void—Before the selection is deleted; false keeps it. onEventDeleted then fires per event.
externalDropbooleanfalseAccept ExternalDraggable items and events dragged out of other schedulers.
externalDragbooleanfalseLet events be dragged out to an ExternalDropZone or another scheduler; an accepted drop removes them here.
onExternalDropOnEvent({ event, data }) => void—Something dragged in was dropped onto an event.
onEventDragLeave / onEventDragEnter(event) => void—With externalDrag: a dragged event crossed the scheduler's edge.
resourceReorderbooleanfalseTimeline: drag rows by a grip to reorder them among their siblings.
onResourceOrderChange({ resources, resource, parent, index }) => void—The new resource tree after a reorder.
onLinkClick(link) => void—A dependency arrow was clicked.
eventOrder(a, b) => numberby startOrder of overlapping events: top lanes in the timeline, left in the time grid, first in calendar and agenda days.
renderCell({ date, resource }) => ReactNode—Content drawn in every empty cell under the events. Renders once per visible cell; keep it light.

Appearance and language

Size, styling hooks and locale.

PropTypeDefaultDescription
heightnumber | string600Height of the scheduler; views scroll inside it.
widthnumber | string—Width of the scheduler.
classNamestring—Classes for the outer element. cssClass is an alias.
styleConfigSchedulerStyleConfigsee SizingRow, lane, hour and column measurements.
themeVariant"light" | "dark" | "auto""auto""dark" forces dark tokens on this scheduler; otherwise a dark class on an ancestor decides.
localeSchedulerLocalelocaleEnLanguage, date formatting and first day of the week.

Completion and compatibility options

New behavior is explicit; controlled data and native callback arguments remain.

PropTypeDefaultDescription
viewModeswitch | combinedswitchCombined stacks configured calendar/timeline/scheduler/agenda and shares navigation/selection; defaultView or configured key order chooses its primary.
responsiveRecord<string, PschResponsiveOptions>—Container-width breakpoints; highest matching entry overrides base. view replaces; styleConfig merges. Standard widths: 0/576/768/992/1200.
pageAnchorDateDateInput—Fixed alignment for multi-period pages; refDate remains current navigation.
ruleResolutionlegacy | specificlegacyLegacy false vetoes; specific resolves event → resource → global, retaining event locks.
dragInTime / dragBetweenSlotsbooleantrueGlobal movement policies; resource/event overrides follow ruleResolution.
dragTimeStepBasedayStart | viewStartlegacyExplicit snap origin shared by creation, movement and resizing.
invalidateEventstrict | start-endstrictAny invalid intersection, or only invalid start/end boundaries.
exclusiveEndDatesbooleantrueFalse converts inclusive input/output ends; internal intervals stay half-open.
generateEventIds / broadcastUnassignedEventsbooleanfalseOpt-in IDs on immutable copies and unassigned-resource broadcasting. Empty resource arrays stay distinct.
labels / markedPschCalendarLabel[] / (PschCalendarMark | DateInput)[]—Independent recurring, styled calendar annotations; labels deliver onLabelClick.
actionableEventsbooleantrueDisable native interactive list wrappers for custom agenda/overflow content.
contextstring | HTMLElementbodyPopup portal container selector or element.
showControls / showEventBufferbooleantrueControl visibility; hidden buffers still participate in conflicts.
connections / groupBy / rtlPschConnection[] / date | resource / boolean—Migration aliases; explicit links, nested scheduler groupBy and dir win.
slotsPschSlot[]—Daily timeline listing slots; missing assignments appear in each. Movement enabled, creation/resizing disabled.
resourceReorderModesiblings | treesiblingsTree mode allows reparenting with cycle prevention; fixed and reorder false resources are protected.
externalResourceDrag / externalResourceDropbooleanfalseCross-instance resources use cancellable before hooks and controlled completion callbacks.
zoomLevelsByKey / zoomLevel / onZoomLevelChangeRecord<string,PschZoomLevel> / string | number / callback—Named configurations and controlled zoom; numeric methods and arrays remain.
calendarSystemPschCalendarSystemGregorianOptional Jalali/Hijri adapters imported from separate calendars/jalali or calendars/hijri paths.
themeVariantauto | system | light | darkautoAuto inherits host; system explicitly follows system color preference.

External drag components

External event drag and drop interfaces
InterfaceTypeBehavior
ExternalDraggable.event / eventsPschExternalEvent / readonly PschExternalEvent[]Provide exactly one. Arrays pack in input order; duration is in minutes.
makeDraggable(element, data)event | readonly event[] | (() => event | readonly event[])Returns cleanup. Supports native dragging from a DOM element.
ExternalDropZone.onDrop(event: SchedulerEvent) => boolean | voidReceives a single event; false refuses the drop.
ExternalDropZone.onEventsDrop(events: SchedulerEvent[]) => boolean | voidRequired for group drops. Receives the whole group once; false refuses all. Also handles singles when onDrop is absent.

Render arguments

type PschCalendarEventData = {
  original: SchedulerEvent   // your event, untouched
  title: string
  start: Date
  end: Date                  // equals start for a point-in-time event
  resource?: string | number
  color?: string             // event colour, else its resource's
  isMultiDay: boolean
}

type EventDraft = { start: Date; end: Date; resource?: string | number; title?: string }

View options

Each key of view takes its own options. See Views for how they combine.

view.timeline

Resources down the side, time across.

PropTypeDefaultDescription
type"day" | "week" | "month" | "year" | "custom""month"The span of one page.
sizenumber1How many spans one page shows.
range{ start, end }—With type "custom": the window to show. Pages are as long as the range and move by its length.
resolutionHorizontal"hour" | "day" | "week" | "month" | "quarter" | "year"by typeThe unit of one axis column: hours for a day (or a custom range up to 3 days), months for a year, days otherwise.
timeCellStepnumber60Minutes per column at hour resolution.
unitWidthPxnumberstyleConfigColumn width for this view.
startDay / endDaynumber (0–6)0 / 6The weekdays that get columns.
startTime / endTime"HH:MM""00:00" / "24:00"The hours that get columns; day columns cover just these hours.
weekNumbersbooleanfalseA header tier of week numbers over day and hour columns.
zoomLevelsPschZoomLevel[]—Zoom steps ({ resolutionHorizontal, timeCellStep?, unitWidthPx, label? }) for ZoomControl and the zoom methods.
zoomLevelnumber0The zoom step to start at.
currentTimeIndicatorbooleantrueDraw a line at the current time.
dragTimeStepnumberprop / 30Snap step in minutes for this view.
maxEventStacknumber | all | auto"all"Stacked events per row before the rest go behind a "+N more" chip per column.
rowHeight"variable" | "equal""variable""equal" makes every row as tall as the tallest.
groupSummarybooleanfalseGroup rows show their descendants' events, faded and read-only.
panelDragNavigatebooleanfalseSwipe sideways to page. Engages only when the axis fits without scrolling and dragToCreate is off.

view.scheduler

Days across, hours down.

PropTypeDefaultDescription
type"day" | "week" | "month" | "custom""week"The span of one page.
sizenumber1How many spans one page shows.
range{ start, end }—With type "custom": the days to show; pages move by the range's length.
weekNumbersbooleanfalseThe week number in the corner above the time gutter.
weekStripbooleanfalseA week strip above the grid for picking the day (a mobile day view).
startDay / endDaynumber (0–6)0 / 6The weekdays to show; 1 and 5 for a working week.
startTime / endTime"HH:MM""00:00" / "24:00"Visible hours. endTime may exceed 24:00 to run into the next day.
timeCellStepnumber60Minutes per grid cell.
timeLabelStepnumber60Minutes per time label.
dragTimeStepnumberprop / 30Snap step in minutes for this view.
periods{ start, end, label? }[]—Fixed periods (a school bell): labels and lines follow them, the gaps between are shaded, and move, resize, create and drops snap to them instead of dragTimeStep.
allDaybooleantrueShow the all-day strip.
currentTimeIndicatorbooleantrueDraw a line at the current time.
cursorTimebooleanfalseShow a line and time label following the pointer.
gridLines"both" | "horizontal" | "vertical" | "none""both"Which grid lines to draw.
fitToHeightbooleanfalseFit the whole time range into the available height.
eventHeight"duration" | "auto""duration""auto" pins events at their start and sizes them to their content (resize off).
resourcesbooleanfalseSplit each day into a column per (leaf) resource, with a second header row.
timezones(string | { timezone, label? })[]—Extra time columns beside the gutter showing the rows' times in other zones.
groupBy"date" | "resource""date"With resources: the resources under each day, or the days under each resource.
maxEventStacknumber | all | auto"all"Side-by-side events per overlap group before a "+N more" chip.
panelDragNavigatebooleanfalseSwipe empty space sideways to page.

view.agenda

A list grouped by day. Beside calendar, it lists the selected day.

PropTypeDefaultDescription
type"day" | "week" | "month" | "year""month"The span of one page.
sizenumber1How many spans one page shows.
showEmptyDaysbooleanfalseList days that have no events.
scrollablebooleantruefalse: the list grows to fit (use height="auto") and the page scrolls.

view.calendar

A grid of days.

PropTypeDefaultDescription
type"month" | "week""month"A full month, or a single week row.
sizenumber1Spans to step by when paging.
weekNumbersbooleanfalseA column of week numbers before each week.
labelsboolean | number | auto | allfalseShow events as bars across their days: true for up to 3 per day, or a number; the rest go behind "+N more". Without it, a count per day.
panelDragNavigatebooleanfalseSwipe the grid sideways to page.

Additional view options

See the feature-completion example for every renderer surface and controlled resource transfers.

PropTypeDefaultDescription
calendarPschCalendarView—year/multi-period size; count/outerDays; exact/fill; labels auto/all; popover/popoverClass; horizontal/vertical scroll. Editing requires eventInteraction true.
schedulerPschScheduleView—dayHeader, empty/invalid column filtering, maxEventStack auto/minEventWidth (100px); virtualScroll opt-in.
timelinePschTimelineView—eventHeight variable/equal; empty/invalid row filtering; vertical days; exact/fill listing; timeLabelStep; minute cells; shifted windows; named columnWidth; virtualScroll defaults true. eventList is deprecated.
callbacksSchedulerCallbacks—Lifecycle, cell/event/resource gestures, drag, annotation and resource CRUD/order hooks. Existing arguments keep optional trailing interaction context.
renderersSchedulerRenderProps—Per-view full → generic full → per-view content → generic content → built-in. Date fields remain; formatted dates/resource/slot/segment/selection enrich context.

Imperative handle

Pass a ref to reach the scheduler from outside. The methods that change events do not change them directly — they fire the same callbacks as the UI, so your state remains the only source of truth.

const scheduler = useRef<ProSchedulerInstance>(null)

<ProScheduler ref={scheduler} … />

scheduler.current?.setView("agenda")
scheduler.current?.navigateToEvent(nextBooking)
ProSchedulerInstance
MethodSignatureDoes
navigate(date)(date: Date) => voidShow the page containing the date and select it.
getSelectedDate()() => DateThe selected day.
setSelectedDate(date)(date: Date) => voidSame as navigate.
getView()() => SchedulerViewTypeThe active view key.
setView(view)(view: SchedulerViewType) => voidSwitch to another configured view.
getEvents(start?, end?)(start?: Date, end?: Date) => SchedulerEvent[]Events overlapping the range, or all of data.
addEvent(event, options?)(SchedulerEventInput | SchedulerEventInput[], {validate?: boolean}?) => voidFires onEventCreated for each — add them to data there.
updateEvent(event, options?)(event, {validate?: boolean}?) => voidFires onEventUpdated.
removeEvent(idOrEvent, options?)(id | event, {validate?: boolean}?) => voidFires onEventDeleted.
navigateToEvent(event)(event) => voidReveal the event’s date, time and resource, expanding ancestors.
zoomIn() / zoomOut()() => voidStep through view.timeline.zoomLevels, keeping the middle of the view in place.
setZoom(level)(level: number) => voidGo to a zoom level (an index into zoomLevels, clamped).
getZoom()() => numberThe current zoom level.
getVisibleEvents()() => SchedulerEvent[]Events in visible configured ranges and resource layouts.
getEventsInRange(start, end?)(DateInput, DateInput?) => SchedulerEvent[]Expanded occurrences overlapping [start,end); single dates cover a complete display-zone day.
getInvalids(start?, end?)(DateInput?, DateInput?) => PschInvalid[]Expanded invalid intervals, or the current page.
getViewDate()() => DateFirst day of the primary view.
getZoomLevel() / setZoomLevel(level)() => number | string / (number | string) => voidNamed or numeric zoom configuration.
addResource / removeResource / reorderResource(...) => booleanCancellable controlled resource changes; completion delivers proposed trees.
print()() => voidPrint the scheduler alone: every row and column, at full height.