ProSchedulerSign in

Features

Selection, drag and drop, links

Select events and act on them together, drag events in from lists and out to drop zones or other schedulers, reorder resources, and draw dependencies between tasks.

Live demo

Select, drag and insert a group

Backlog insertion, packed moves, transfers and unscheduling.

Bulk insertion and packed moves

Pass an ordered events array to ExternalDraggable to insert tasks together. With selectMultipleEvents and dragSelectedEvents, dragging a selected event packs the selection in original start-time order. The first start snaps to the destination; each event keeps its exact duration and the next starts when it ends, on the same target resource.

Time grids and timed timelines preview every event. Rules, buffers, availability and before callbacks apply to the whole group: a refusal leaves all events in place. There are no automatic gaps or searches for free space. Bulk packing requires timed events with positive durations; month calendars, agendas, all-day events and point events keep their existing single-event behavior.

Enable externalDrag and externalDrop to transfer groups between schedulers. A drop zone needs onEventsDrop to receive a group once. Source deletion callbacks run before destination persistence notifications; if any source deletion is refused, the entire group is copied. Only selected recurring occurrences move, with merged series exceptions and standalone replacements. Existing destination IDs refuse a batch.

Use eventChangeDelivery="transaction" to apply created, updated and deleted together. Without it, the existing per-event after callbacks remain. makeDraggable(element, events) also accepts arrays or a callback returning an array.

<ExternalDraggable events={backlog.filter((task) => checkedIds.includes(task.id))}>
  Drag selected tasks
</ExternalDraggable>

<ProScheduler
  data={events}
  selectMultipleEvents
  dragSelectedEvents
  externalDrop
  externalDrag
  eventChangeDelivery="transaction"
  onEventTransaction={({ created, updated, deleted }) => {
    setEvents((current) => {
      const replaced = new Set([...updated, ...deleted].map((event) => event.id))
      return [...current.filter((event) => !replaced.has(event.id)), ...updated, ...created]
    })
    setBacklog((current) => current.filter((task) => !created.some((event) => event.id === task.id)))
  }}
/>

<ExternalDropZone onEventsDrop={(events) => unscheduleTogether(events)}>
  Drop a selected group here
</ExternalDropZone>

Selecting several events

With selectMultipleEvents a click toggles an event in the selection instead of opening the editor (a double click does that). Delete or Backspace removes the selection when eventDelete is on, Escape clears it. Selected events are outlined in every view. Occurrences of a recurring event are removed as exceptions to their series, in one update per series.

const [selected, setSelected] = useState<SchedulerEvent[]>([])

<ProScheduler
  selectMultipleEvents
  selectedEvents={selected}                 // optional: controlled
  onSelectedEventsChange={setSelected}
  onEventsDelete={(events) => confirm(`Delete ${events.length}?`)} // Delete key; false keeps them
  onEventDeleted={(event) => remove(event)} // then once per event
/>

Dragging in

Wrap anything in ExternalDraggable with the event it becomes — duration (minutes) sets its length when it has no start and end. A scheduler with externalDrop shows where it would land, and a drop goes through the usual create path: rules first, then onEventCreate (with draft.external) and onEventCreated. The event keeps the fields you gave it, id included. Outside React, makeDraggable(element, event) does the same for a plain DOM element.

import { ExternalDraggable, ProScheduler } from "@andreisaac/pro-scheduler"

{backlog.map((task) => (
  <ExternalDraggable key={task.id} event={{ id: task.id, title: task.title, duration: 90 }}>
    <TaskCard task={task} />
  </ExternalDraggable>
))}

<ProScheduler
  externalDrop
  onEventCreate={(draft) => draft.external?.id !== "locked"} // draft.external: what was dropped
  onEventCreated={(event) => { add(event); removeFromBacklog(event.id) }}
  onExternalDropOnEvent={({ event, data }) => addAttendee(event, data)} // dropped onto an event
/>

With onExternalDropOnEvent, dropping onto an event hands you both instead of creating one — see the attendees demo.

Dragging out, and between schedulers

With externalDrag, an event dragged past the scheduler’s edge follows the pointer. Dropped on an ExternalDropZone or on another scheduler with externalDrop, it’s taken there and removed here through onEventDelete / onEventDeleted — return false from onEventDelete to copy instead of move. Dropped anywhere else, it snaps back. onEventDragLeave and onEventDragEnter report it crossing the edge.

import { ExternalDropZone } from "@andreisaac/pro-scheduler"

<ExternalDropZone onDrop={(event) => unschedule(event)} className="data-[over]:bg-primary/5">
  Drop here to unschedule
</ExternalDropZone>

<ProScheduler
  externalDrag
  onEventDragLeave={(event) => setHint(`Drop ${event.title} on the list`)}
  onEventDeleted={(event) => remove(event)} // fired once a target accepts the drop
/>

Reordering resources

resourceReorder gives each timeline row a grip. Rows move among their siblings — a child stays in its group — and onResourceOrderChange hands back the whole tree in the new order.

const [resources, setResources] = useState(teams)

<ProScheduler
  resources={resources}
  resourceReorder
  onResourceOrderChange={({ resources, resource, parent, index }) => setResources(resources)}
/>

links draws arrows between timeline events by id: from the end of one to the start of the next by default, or start-start, finish-finish and start-finish. Arrows route around bars when a task starts before its predecessor ends, and follow a task while it’s dragged. They’re drawn only; keeping dependent tasks in order is up to your onEventUpdate.

<ProScheduler
  links={[
    { from: "brief", to: "design" },                          // finish → start
    { from: "build-api", to: "build-ui", type: "start-start" },
    { from: "test", to: "launch", color: "#dc2626" },
  ]}
  onLinkClick={(link) => openLink(link)}
/>