ProSchedulerSign in

Timeline · Look & feel

Resource row styling

background and cssClass on a resource style its whole row — here by role, with the lead's row marked.

Live demo

Compare the directors' rows with the rest

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

export function RowStylingDemo() {
  const { events, handlers } = useEvents(studioAssignments)
  const styled = studioResources.map((r, i) => ({
    ...r,
    // Row background by role family; the lead's row stands out with a class.
    background: ["Director", "Producer"].includes(r.role)
      ? "color-mix(in oklab, #2563eb 6%, transparent)"
      : i % 2
        ? "color-mix(in oklab, currentColor 3%, transparent)"
        : undefined,
    cssClass: r.id === "ada" ? "border-l-4 border-l-primary" : undefined,
  }))

  return (
    <ProScheduler
      data={events}
      resources={styled}
      view={{ timeline: { type: "month" } }}
      height={520}
      {...handlers}
    />
  )
}

About this demo

background and cssClass on a resource style its whole row — here by role, with the lead's row marked.

Things to try

  • Compare the directors' rows with the rest

The props behind it are explained in Sizing & theming.

Use ProScheduler in your project