ProSchedulerSign in

Scheduler · Look & feel

CSS classes for cells

A colour range's cssClass takes any classes — Tailwind utilities with dark-mode variants here — for the parts of the day you want marked.

Live demo

Switch the site to dark mode

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

const zones: PschColor[] = [
  { recurring: { repeat: "daily" }, startTime: "07:00", endTime: "09:00", title: "Early", cssClass: "bg-sky-500/10 text-sky-700 dark:text-sky-300" },
  { recurring: { repeat: "daily" }, startTime: "12:00", endTime: "13:00", title: "Lunch", cssClass: "bg-amber-500/15 text-amber-700 dark:text-amber-300" },
  { recurring: { repeat: "daily" }, startTime: "17:00", endTime: "20:00", title: "Evening", cssClass: "bg-violet-500/10 text-violet-700 dark:text-violet-300" },
  { recurring: { repeat: "weekly", weekDays: [0, 6] }, cssClass: "bg-muted/60" },
]

export function CellClassesDemo() {
  const { events, handlers } = useEvents(studioSessions)

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      view={{ scheduler: { type: "week", startTime: "07:00", endTime: "20:00" } }}
      // cssClass takes any classes — Tailwind utilities here, with dark variants.
      colors={zones}
      height={600}
      {...handlers}
    />
  )
}

About this demo

A colour range's cssClass takes any classes — Tailwind utilities with dark-mode variants here — for the parts of the day you want marked.

Things to try

  • Switch the site to dark mode

The props behind it are explained in Sizing & theming.

Use ProScheduler in your project