Quickstart: Implement the Scheduler component
masterTo use the Scheduler, follow these three steps:
- Import required styles: The component requires its CSS to render correctly.
- Import the component: Import
SchedulerandSchedulerDatafrom@bitnoi.se/react-scheduler. - Provide data and props: Pass your data and event handlers to the
<Scheduler />component.
Note: The example below uses dayjs for date calculations, but you are free to use any date library of your choice.
import "@bitnoi.se/react-scheduler/dist/style.css";
import { Scheduler, SchedulerData } from "@bitnoi.se/react-scheduler";
import dayjs from "dayjs";
export default function Component() {
// ... implementation logic ...
return (
<Scheduler
data={filteredData}
isLoading={isLoading}
onRangeChange={handleRangeChange}
onTileClick={(clickedResource) => console.log(clickedResource)}
onItemClick={(item) => console.log(item)}
onFilterData={() => {}}
onClearFilterData={() => {}}
config={{ zoom: 0 }}
/>
);
}