ProSchedulerSign in

Agenda · Look & feel

Theme presets

The calendar and its agenda in each preset theme.

Live demo

Switch presets

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

const themes = ["default", "slate", "rose", "emerald", "amber"] as const

type Theme = (typeof themes)[number]

/** Theme presets are token overrides scoped to a class: `psch-theme-<name>`. */
function ThemePicker({ value, onChange }: { value: Theme; onChange: (theme: Theme) => void }) {
  return (
    <Toolbar label="Theme">
      {themes.map((t) => (
        <Choice key={t} active={value === t} onClick={() => onChange(t)}>
          {t[0].toUpperCase() + t.slice(1)}
        </Choice>
      ))}
    </Toolbar>
  )
}

export function AgendaThemesDemo() {
  const { events, handlers } = useEvents(() => studioSessions())
  const [theme, setTheme] = useState<Theme>("emerald")
  return (
    <div className={theme === "default" ? undefined : `psch-theme-${theme}`}>
      <ThemePicker value={theme} onChange={setTheme} />
      <ProScheduler
        data={events}
        resources={studioResources}
        view={{ calendar: { type: "month", labels: 2 }, agenda: { type: "day" } }}
        height={680}
        {...handlers}
      />
    </div>
  )
}

About this demo

The calendar and its agenda in each preset theme.

Things to try

  • Switch presets

The props behind it are explained in Output and scale.

Use ProScheduler in your project