View on GitHub

Interactions and callbacks

This reference covers time-grid occurrence data and the payloads emitted by movement and resize callbacks. The interaction guide explains how to apply these contracts in a controlled calendar.

Event interaction context

CalendarEventInteractionContext<Resource> identifies the view and the exact rendered occurrence. Its occurrence contains normalized day, concrete resource (or null), and stable resourceId (or null). This matters when one source event appears on several days or resources.

Raw onClick, onDoubleClick, onContextMenu, and onKeyDown callbacks each receive (event, interaction, context). They observe the browser's real event sequence: for example, a double-click produces two raw clicks and one raw double-click while semantic selection runs once and semantic opening runs once. ariaKeyShortcuts accepts a string or (event, context) => string; its tokens are deduplicated with the built-in Space/Enter shortcuts.

Time-grid interaction payloads

TimeGridColumn<Resource>

FieldMeaningExample
dayNormalized visible day represented by the column.new Date(2026, 8, 14)
resourceConcrete resource item, or null when the grid has no resources.{ id: "studio", name: "Studio" }
resourceIdStable resource identity, or null without resources."studio"

TimeGridSlot<Resource>

FieldMeaningExample
start, endHalf-open wall-clock interval.09:00 through 09:30 on the owning day
durationActual minutes; the last uneven slot may be shorter.30
dayNormalized day owning the slot.new Date(2026, 8, 14)
resourceConcrete resource item, or null without resources.{ id: "studio", name: "Studio" }
resourceIdStable resource identity, or null without resources."studio"

TimeGridEventSegment<Resource>

FieldMeaningExample
layoutRegion rendering the segment: "timed" for a single day/resource column or "dedicated" for an aligned multi-day bar."dedicated"
start, endVisible half-open interval. Timed segments are clipped to one day and the time window; dedicated segments are clipped to their contiguous visible day span.new Date(2026, 8, 14, 14) through new Date(2026, 8, 16, 11)
dayNormalized owning day for a timed segment or first visible day for a dedicated segment.new Date(2026, 8, 14)
resourceConcrete resource column item, or null without resources.{ id: "studio", name: "Studio" }
resourceIdStable resource column identity, or null without resources."studio"

The complete normalized source event is the separate event renderer/callback argument. CSS rows, overlap lanes, generated keys, and flattened column indexes are private; the library supplies their effect through elementProps.

Export-surface migration

Removed public contractReplacement
TimeGridEventLayout and segment row/lane/index fieldsUse TimeGridEventSegment for semantic interval/resource data and spread the positioned elementProps in renderers.
TimeGridColumn.key, dayIndex, and resourceIndexUse day, resource, and resourceId; derive application-specific ordering from the columns array only when needed.
TimeGridSlot.key, indexes, and divider stateUse start, end, duration, day, resource, and resourceId; slot placement and classes remain library-owned.
setDate and setTime package exportsPass CalendarDateInput, use the public normalization functions, or use the corresponding date-fns operation directly.
createCalendarRange, getCalendarRangeBounds, and moveCalendarDate package exportsDescribe the range with CalendarRangeDefinition; call resolveCalendarRange when custom view code needs resolved days/navigation.

TimeGridEventPosition<Resource>

A shared { day, resource, resourceId } position describes where movement or resize originates and, for movement, where it lands.

TimeGridEventDrop<Event, Resource>

event is the normalized source. start and end are proposed complete boundaries. source and destination each contain day, concrete resource, and resourceId:

{
    event: planning,
    start: new Date(2026, 8, 15, 11, 0),
    end: new Date(2026, 8, 15, 12, 15),
    source: { day: monday, resource: studio, resourceId: "studio" },
    destination: { day: tuesday, resource: workshop, resourceId: "workshop" }
}

TimeGridEventResize<Event, Resource>

edge is "start" | "end". start and end are the proposed complete source boundaries. source identifies the rendered day/resource occurrence; resizing never changes that resource.

{
    event: planning,
    edge: "end",
    start: new Date(2026, 8, 14, 9, 0),
    end: new Date(2026, 8, 14, 10, 30),
    source: { day: monday, resource: studio, resourceId: "studio" }
}