ProSchedulerSign in

Features

Views

A resource timeline, a vertical time grid, an agenda list and a month calendar. Use one, offer several behind a switcher, or pair the calendar with the agenda.

Choosing a view

The four views
KeyLayoutSpansBest for
timelineResources down, time acrossday · week · month · yearRosters, equipment, rooms, crews
schedulerDays across, hours downday · week · monthAppointments, calendars, shifts
agendaA list grouped by dayday · week · month · yearPhones, print, “what’s next”
calendarMonth or week grid of daysmonth · weekOverview, date picking

Resource timeline

One row per resource, time running left to right. Rows grow to fit overlapping events, which stack into lanes. Rows are virtualized, so hundreds of resources scroll smoothly. With styleConfig.fitToWidth (the default) the axis stretches to the panel; past a minimum column width it scrolls horizontally instead.

<ProScheduler
  data={events}
  resources={people}
  view={{
    timeline: {
      type: "month",              // "day" | "week" | "month" | "year"
      size: 1,                    // how many of them side by side
      resolutionHorizontal: "day", // column unit: "hour" … "year"
      dragTimeStep: 60,
    },
  }}
/>
Live demo

A month of assignments

Drag a bar to another person, stretch it from either end, or drag across an empty row to create one.

import { useMemo, useState, useSyncExternalStore } from "react"
import { ProScheduler, type SchedulerEvent } from "@/components/pro-scheduler"
import { studioAssignments, studioResources } from "@/lib/demo-data/studio"

const subscribe = () => () => {}

/** False during the server render and hydration, true afterwards. */
function useHydrated() {
  return useSyncExternalStore(subscribe, () => true, () => false)
}

function Placeholder({ height }: { height: number }) {
  return <div aria-hidden className="docs-demo__placeholder" style={{ height }} />
}

/**
 * ProScheduler is controlled: it never edits `data` itself. The callbacks below
 * are the whole contract — apply the change, and the view re-renders from it.
 */
function useEvents(initial: () => SchedulerEvent[]) {
  const [events, setEvents] = useState(initial)

  const handlers = useMemo(
    () => ({
      onEventCreated: (event: SchedulerEvent) =>
        setEvents((list) => [...list, { ...event, id: crypto.randomUUID() }]),
      onEventUpdated: (event: SchedulerEvent) =>
        setEvents((list) => list.map((e) => (e.id === event.id ? event : e))),
      onEventDeleted: (event: SchedulerEvent) =>
        setEvents((list) => list.filter((e) => e.id !== event.id)),
    }),
    []
  )

  return { events, setEvents, handlers }
}

export function TimelineDemo() {
  const hydrated = useHydrated()
  const { events, handlers } = useEvents(studioAssignments)
  if (!hydrated) return <Placeholder height={560} />

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      view={{ timeline: { type: "month" } }}
      height={560}
      {...handlers}
    />
  )
}

Time grid (day, week, month)

Days as columns, hours down the side — the classic calendar week. Overlapping events share the column side by side. timeCellStep sets the grid granularity; dragTimeStep sets what interactions snap to, independently.

view={{
  scheduler: {
    type: "week",               // "day" | "week" | "month"
    startTime: "07:00",
    endTime: "20:00",           // may run past midnight: "26:00"
    timeCellStep: 30,           // grid granularity, in minutes
    timeLabelStep: 60,
    dragTimeStep: 15,           // what move / resize / create snap to
    startDay: 1, endDay: 5,     // Monday to Friday only
    allDay: true,               // the all-day strip under the day headers
    currentTimeIndicator: true,
    cursorTime: true,
    gridLines: "both",          // "horizontal" | "vertical" | "none"
    fitToHeight: false,         // true: whole range fits, no vertical scroll
    eventHeight: "duration",    // "auto": pinned at start, sized to content
  },
}}

Periods: a school bell

When the day runs on fixed periods rather than a clock, pass them as periods. The time labels and lines follow the periods and the gaps between them are shaded. Moves, drops from outside, resizes and new events snap to them instead of dragTimeStep: an event starts on a period, and one longer than a period only where back-to-back periods hold it — a 90-minute lesson takes a double period and never straddles a break. Gaps aren't blocked; add an invalid range for that (lunch, say). The school timetable on the home page runs on this bell.

view={{
  scheduler: {
    type: "week",
    startDay: 1, endDay: 5,
    startTime: "08:15",
    endTime: "18:45",
    // A school bell: 45-minute periods, breaks of different lengths.
    periods: [
      { start: "08:30", end: "09:15" }, { start: "09:15", end: "10:00" },
      { start: "10:30", end: "11:15" }, { start: "11:15", end: "12:00" },
      { start: "12:15", end: "13:00" },
      { start: "14:00", end: "14:45" },
      { start: "15:00", end: "15:45" }, { start: "15:45", end: "16:30" },
      { start: "16:45", end: "17:30" }, { start: "17:45", end: "18:30" },
    ],
  },
}}
Live demo

Week view

07:00–20:00 in half-hour cells, 15-minute snapping, a current-time line and a cursor time readout.

import { useMemo, useState, useSyncExternalStore } from "react"
import { ProScheduler, type SchedulerEvent } from "@/components/pro-scheduler"
import { studioResources, studioSessions } from "@/lib/demo-data/studio"

const subscribe = () => () => {}

/** False during the server render and hydration, true afterwards. */
function useHydrated() {
  return useSyncExternalStore(subscribe, () => true, () => false)
}

function Placeholder({ height }: { height: number }) {
  return <div aria-hidden className="docs-demo__placeholder" style={{ height }} />
}

/**
 * ProScheduler is controlled: it never edits `data` itself. The callbacks below
 * are the whole contract — apply the change, and the view re-renders from it.
 */
function useEvents(initial: () => SchedulerEvent[]) {
  const [events, setEvents] = useState(initial)

  const handlers = useMemo(
    () => ({
      onEventCreated: (event: SchedulerEvent) =>
        setEvents((list) => [...list, { ...event, id: crypto.randomUUID() }]),
      onEventUpdated: (event: SchedulerEvent) =>
        setEvents((list) => list.map((e) => (e.id === event.id ? event : e))),
      onEventDeleted: (event: SchedulerEvent) =>
        setEvents((list) => list.filter((e) => e.id !== event.id)),
    }),
    []
  )

  return { events, setEvents, handlers }
}

export function WeekDemo() {
  const hydrated = useHydrated()
  const { events, handlers } = useEvents(studioSessions)
  if (!hydrated) return <Placeholder height={620} />

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      view={{
        scheduler: {
          type: "week",
          startTime: "07:00",
          endTime: "20:00",
          timeCellStep: 30,
          dragTimeStep: 15,
          currentTimeIndicator: true,
          cursorTime: true,
        },
      }}
      height={620}
      {...handlers}
    />
  )
}

Agenda

A virtualized list of events grouped by day, spanning the type and size you choose. Empty days are skipped unless showEmptyDays is set.

view={{ agenda: { type: "week", size: 2, showEmptyDays: false } }}
Live demo

Two weeks as a list

Page forward, open an event to edit it.

import { useMemo, useState, useSyncExternalStore } from "react"
import { ProScheduler, type SchedulerEvent } from "@/components/pro-scheduler"
import { studioResources, studioSessions } from "@/lib/demo-data/studio"

const subscribe = () => () => {}

/** False during the server render and hydration, true afterwards. */
function useHydrated() {
  return useSyncExternalStore(subscribe, () => true, () => false)
}

function Placeholder({ height }: { height: number }) {
  return <div aria-hidden className="docs-demo__placeholder" style={{ height }} />
}

/**
 * ProScheduler is controlled: it never edits `data` itself. The callbacks below
 * are the whole contract — apply the change, and the view re-renders from it.
 */
function useEvents(initial: () => SchedulerEvent[]) {
  const [events, setEvents] = useState(initial)

  const handlers = useMemo(
    () => ({
      onEventCreated: (event: SchedulerEvent) =>
        setEvents((list) => [...list, { ...event, id: crypto.randomUUID() }]),
      onEventUpdated: (event: SchedulerEvent) =>
        setEvents((list) => list.map((e) => (e.id === event.id ? event : e))),
      onEventDeleted: (event: SchedulerEvent) =>
        setEvents((list) => list.filter((e) => e.id !== event.id)),
    }),
    []
  )

  return { events, setEvents, handlers }
}

export function AgendaDemo() {
  const hydrated = useHydrated()
  const { events, handlers } = useEvents(studioSessions)
  if (!hydrated) return <Placeholder height={520} />

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      view={{ agenda: { type: "week", size: 2 } }}
      height={520}
      {...handlers}
    />
  )
}

Calendar, with or without agenda

A month (or single-week) grid of days with an event count on each. Picking a day selects it; with agenda alongside, that day’s events list underneath and both share one navigation. panelDragNavigate lets a sideways swipe page the months.

// Grid on top, the selected day's list underneath, one navigation.
view={{
  calendar: { type: "month", panelDragNavigate: true },
  agenda: { type: "day" },
}}
Live demo

Month calendar with agenda

Pick a day to list its events; swipe the grid to change month.

import { useMemo, useState, useSyncExternalStore } from "react"
import { ProScheduler, type SchedulerEvent } from "@/components/pro-scheduler"
import { studioEvents, studioResources } from "@/lib/demo-data/studio"

const subscribe = () => () => {}

/** False during the server render and hydration, true afterwards. */
function useHydrated() {
  return useSyncExternalStore(subscribe, () => true, () => false)
}

function Placeholder({ height }: { height: number }) {
  return <div aria-hidden className="docs-demo__placeholder" style={{ height }} />
}

/**
 * ProScheduler is controlled: it never edits `data` itself. The callbacks below
 * are the whole contract — apply the change, and the view re-renders from it.
 */
function useEvents(initial: () => SchedulerEvent[]) {
  const [events, setEvents] = useState(initial)

  const handlers = useMemo(
    () => ({
      onEventCreated: (event: SchedulerEvent) =>
        setEvents((list) => [...list, { ...event, id: crypto.randomUUID() }]),
      onEventUpdated: (event: SchedulerEvent) =>
        setEvents((list) => list.map((e) => (e.id === event.id ? event : e))),
      onEventDeleted: (event: SchedulerEvent) =>
        setEvents((list) => list.filter((e) => e.id !== event.id)),
    }),
    []
  )

  return { events, setEvents, handlers }
}

export function CalendarDemo() {
  const hydrated = useHydrated()
  const { events, handlers } = useEvents(studioEvents)
  if (!hydrated) return <Placeholder height={680} />

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      // A month grid on top, the selected day's events below — one navigation.
      view={{ calendar: { type: "month", panelDragNavigate: true }, agenda: { type: "day" } }}
      height={680}
      {...handlers}
    />
  )
}

Several views, one scheduler

Put more than one key in view and the header grows a view switcher. The selected date carries across, so switching from the week to the timeline keeps you on the same week.

view={{
  scheduler: { type: "week", startTime: "07:00", endTime: "20:00" },
  timeline: { type: "month" },
  agenda: { type: "month" },
}}
defaultView="scheduler" // otherwise the timeline would open first
Live demo

Week, timeline and agenda

Use the switcher at the top right.

import { useMemo, useState, useSyncExternalStore } from "react"
import { ProScheduler, type SchedulerEvent } from "@/components/pro-scheduler"
import { studioEvents, studioResources } from "@/lib/demo-data/studio"

const subscribe = () => () => {}

/** False during the server render and hydration, true afterwards. */
function useHydrated() {
  return useSyncExternalStore(subscribe, () => true, () => false)
}

function Placeholder({ height }: { height: number }) {
  return <div aria-hidden className="docs-demo__placeholder" style={{ height }} />
}

/**
 * ProScheduler is controlled: it never edits `data` itself. The callbacks below
 * are the whole contract — apply the change, and the view re-renders from it.
 */
function useEvents(initial: () => SchedulerEvent[]) {
  const [events, setEvents] = useState(initial)

  const handlers = useMemo(
    () => ({
      onEventCreated: (event: SchedulerEvent) =>
        setEvents((list) => [...list, { ...event, id: crypto.randomUUID() }]),
      onEventUpdated: (event: SchedulerEvent) =>
        setEvents((list) => list.map((e) => (e.id === event.id ? event : e))),
      onEventDeleted: (event: SchedulerEvent) =>
        setEvents((list) => list.filter((e) => e.id !== event.id)),
    }),
    []
  )

  return { events, setEvents, handlers }
}

export function MultiViewDemo({ height = 640 }: { height?: number }) {
  const hydrated = useHydrated()
  const { events, handlers } = useEvents(studioEvents)
  if (!hydrated) return <Placeholder height={height} />

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      view={{
        scheduler: { type: "week", startTime: "07:00", endTime: "20:00", dragTimeStep: 15 },
        timeline: { type: "month" },
        agenda: { type: "month" },
      }}
      defaultView="scheduler"
      height={height}
      {...handlers}
    />
  )
}