ProSchedulerSign in

Scheduler · Resources

Resource background styling

Per-column background, plus resource-scoped colour ranges for each person's hours.

Live demo

Find Ada's office hours

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

const tints: PschColor[] = [
  { recurring: { repeat: "daily" }, startTime: "09:00", endTime: "12:00", resource: "ada", title: "Office hours", background: "color-mix(in oklab, #2563eb 10%, transparent)" },
  { recurring: { repeat: "daily" }, startTime: "14:00", endTime: "18:00", resource: "ben", title: "Calls", background: "color-mix(in oklab, #059669 10%, transparent)" },
]

export function ResourceBackgroundDemo() {
  const { events, handlers } = useEvents(studioSessions)
  const people: SchedulerResource[] = studioResources.slice(0, 4).map((r, i) => ({
    ...r,
    // Whole-column tint per person; ranges add per-person hours on top.
    background: i % 2 ? "color-mix(in oklab, currentColor 3%, transparent)" : undefined,
  }))

  return (
    <ProScheduler
      data={events}
      resources={people}
      view={{ scheduler: { type: "day", resources: true, startTime: "07:00", endTime: "20:00" } }}
      colors={tints}
      height={580}
      {...handlers}
    />
  )
}

About this demo

Per-column background, plus resource-scoped colour ranges for each person's hours.

Things to try

  • Find Ada's office hours

The props behind it are explained in Sizing & theming.

Use ProScheduler in your project