ProSchedulerSign in

Agenda · Setting up

Events by day with a calendar

A week strip or month grid on top, the picked day's events below — the calendar and agenda share one navigation.

Live demo

Pick another day · Swipe the strip to the next week · Switch to the month grid

Fullscreen
import { useState } from "react"
import { ProScheduler } from "@andreisaac/pro-scheduler"
import { studioEvents, studioResources } from "./data/studio"
import { Choice, Toolbar, useEvents } from "./kit"

export function CalendarAgendaDemo() {
  const { events, handlers } = useEvents(studioEvents)
  const [grid, setGrid] = useState<"month" | "week">("week")

  return (
    <div className="docs-demo__stack">
      <Toolbar label="Calendar">
        <Choice active={grid === "week"} onClick={() => setGrid("week")}>
          Week strip
        </Choice>
        <Choice active={grid === "month"} onClick={() => setGrid("month")}>
          Month grid
        </Choice>
      </Toolbar>
      <ProScheduler
        key={grid}
        data={events}
        resources={studioResources}
        // calendar + agenda: pick a day above, read its events below.
        view={{ calendar: { type: grid, panelDragNavigate: true }, agenda: { type: "day" } }}
        height={grid === "week" ? 560 : 680}
        {...handlers}
      />
    </div>
  )
}

About this demo

A week strip or month grid on top, the picked day's events below — the calendar and agenda share one navigation.

Things to try

  • Pick another day
  • Swipe the strip to the next week
  • Switch to the month grid

The props behind it are explained in Views.

Use ProScheduler in your project