ProSchedulerSign in

Scheduler · Drag & drop

Drag, resize and move restrictions

Per-event rules: resize: false keeps the duration, dragInTime: false fixes the time, editable: false locks the event entirely.

Live demo

Try to resize the blue event · Try to drag the amber one · Move the green ones freely

Fullscreen
import { ProScheduler, type SchedulerEvent } from "@andreisaac/pro-scheduler"
import { weekStart } from "./data/studio"
import { useEvents } from "./kit"

export function RestrictionsDemo() {
  const { events, handlers } = useEvents<SchedulerEvent>(() => {
    const monday = weekStart()
    const at = (day: number, h: number, m = 0) =>
      new Date(monday.getFullYear(), monday.getMonth(), monday.getDate() + day, h, m)
    return [
      { id: 1, title: "Free: move and resize", start: at(0, 9), end: at(0, 11), color: "#059669" },
      { id: 2, title: "Fixed length (resize: false)", start: at(1, 10), end: at(1, 11, 30), resize: false, color: "#2563eb" },
      { id: 3, title: "Fixed time (dragInTime: false)", start: at(2, 9), end: at(2, 10), dragInTime: false, color: "#d97706" },
      { id: 4, title: "Locked (editable: false)", start: at(3, 13), end: at(3, 15), editable: false, color: "#64748b" },
      { id: 5, title: "Free again", start: at(4, 14), end: at(4, 15), color: "#059669" },
    ]
  })

  return (
    <ProScheduler
      data={events}
      view={{ scheduler: { type: "week", startTime: "08:00", endTime: "17:00", fitToHeight: true } }}
      height={520}
      {...handlers}
    />
  )
}

About this demo

Per-event rules: resize: false keeps the duration, dragInTime: false fixes the time, editable: false locks the event entirely.

Things to try

  • Try to resize the blue event
  • Try to drag the amber one
  • Move the green ones freely

The props behind it are explained in Rules and backgrounds.

Use ProScheduler in your project