ProSchedulerSign in

Scheduler · Look & feel

Theme presets

Four presets — slate, rose, emerald and amber — each a class that overrides the shadcn/ui tokens, light and dark. Import @andreisaac/pro-scheduler/themes/rose.css and add psch-theme-rose.

Live demo

Switch presets · Open an event: the editor follows the theme

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 SchedulerThemesDemo() {
  const { events, handlers } = useEvents(() => studioSessions())
  const [theme, setTheme] = useState<Theme>("rose")
  return (
    // The class goes on a wrapper so the editor (which portals out) is themed too.
    <div className={theme === "default" ? undefined : `psch-theme-${theme}`}>
      <ThemePicker value={theme} onChange={setTheme} />
      <ProScheduler
        data={events}
        resources={studioResources}
        view={{ scheduler: { type: "week", startTime: "08:00", endTime: "19:00" } }}
        height={560}
        {...handlers}
      />
    </div>
  )
}

About this demo

Four presets — slate, rose, emerald and amber — each a class that overrides the shadcn/ui tokens, light and dark. Import @andreisaac/pro-scheduler/themes/rose.css and add psch-theme-rose.

Things to try

  • Switch presets
  • Open an event: the editor follows the theme

The props behind it are explained in Output and scale.

Use ProScheduler in your project