Skip to content

Components · Display

ScheduleCalendar

Month, week, and day calendar views with event rendering, drag-to-create, and merge-aware overlays for showing consolidated activities.

Key points

  • Three views: month, week, day. View is controlled via the view prop.
  • Reads events directly from the engine via the active provider — no manual fetching needed
  • Supports drag-to-create when enableDragCreate is set; fires onSlotCreate with the dragged range
  • Custom event rendering via renderEvent for non-default visuals

Import

import { ScheduleCalendar } from '@flexischeduler/scheduling-components';

ScheduleCalendar is the heaviest component in the library — it bundles the calendar grid, event layout engine, and drag interaction handlers. If you import it, expect ~45kb gzipped. Other components are much smaller.

Basic usage

Render a week view for a single staff member, navigating to an event detail page on click:

<ScheduleCalendar
  view="week"
  entityId="ent_staff_a8f4"
  startDate={new Date('2026-05-01')}
  onEventClick={(event) => navigate(`/events/${event.id}`)}
/>

The component fetches events for the entity and date range automatically. Pagination, caching, and refetching on filter change are all handled internally.

Reference

Props

Name

Type

Description

view

required

"month" | "week" | "day"

Calendar view mode

entityId
string

Filter to events involving this entity. Omit to show all events in the organization.

eventType
string

Filter to a specific event type

startDate
Date

default: today

Anchor date for the displayed range

enableDragCreate
boolean

default: false

Enable drag-to-create slot interaction

showMergedOverlay
boolean

default: true

Visually group events that share merge metadata

renderEvent
(event: Event) => ReactNode

Custom render function for event blocks

Events

Event

Payload

Fires when

onEventClick(event: Event) => void

User clicked an event block

onSlotCreate(slot: { startTime, endTime }) => void

User dragged to create a slot (requires enableDragCreate)

onViewChange(view: "month" | "week" | "day") => void

User changed the view mode through the built-in toggle

onDateChange(date: Date) => void

User navigated to a different date range

Drag to create

Setting enableDragCreate turns the empty grid cells into drag targets. Dragging fires onSlotCreate with the range; typically you’d open an EventEditor prefilled with the dragged times:

<ScheduleCalendar
  view="day"
  entityId="ent_staff_a8f4"
  enableDragCreate
  onSlotCreate={(slot) => {
    openEventEditor({
      startTime: slot.startTime,
      endTime: slot.endTime,
      primaryEntityId: 'ent_staff_a8f4',
    });
  }}
/>

Custom event rendering

For non-default event visuals (status badges, custom icons, domain-specific labels), pass a renderEvent function. The function receives the full event object:

<ScheduleCalendar
  view="week"
  entityId="ent_staff_a8f4"
  renderEvent={(event) => (
    <div className="custom-event-card">
      <strong>{event.title}</strong>
      <span>{event.eventType}</span>
    </div>
  )}
/>

The custom node is positioned automatically by the layout engine — you don’t need to manage absolute positioning or overlap handling.

Use the merge overlay

When events share a merge group (consolidated visits, linked sessions), the calendar draws a subtle copper outline grouping them. This makes the “these are happening together” relationship visible without forcing the user to click through. Disable with showMergedOverlay={false} if your domain doesn’t use merging.