Getting Started with the React Scheduler
To create a new Vite project, refer to the Vite documentation. Once that Vite project is ready to run with default settings, let's add the React Scheduler component to the project.
Installing Syncfusion® React package
To use the Scheduler component, install the @syncfusion/react-scheduler package:
Adding CSS reference
Import the Scheduler component's required CSS references as follows in src/App.css.
Adding Scheduler component
To include the Scheduler component in your application, import the Scheduler from @syncfusion/react-scheduler package in App.tsx.
Add the Scheduler component to your application and include the required components as its children.
Populating appointments
The Scheduler component allows displaying appointment data by binding it to the eventSettings property. Appointments can be defined with fields such as Subject, StartTime, EndTime, and Location. These entries are rendered within the appropriate time slots based on the selected view such as Day, Week, or Month.
Setting date
By default, the Scheduler displays the current system date. Scheduler supports both controlled and uncontrolled modes to set a selected date. For uncontrolled mode, to display a specific date instead, assign the desired value to the defaultSelectedDate property. This sets the initial visible date when the Scheduler is rendered. For controlled mode, use the selectedDate and onSelectedDateChange properties to control the selected date in Scheduler.
Setting view
The Scheduler component supports multiple view modes such as Day, Week, Workweek and Month. These views determine how appointments are displayed and navigated. The Scheduler supports both controlled and uncontrolled modes to set a view. For uncontrolled mode, assign the desired name to the defaultView property. For controlled mode, use the view and onViewChange properties. This helps tailor the Schedule layout based on the context or use case.
Run the project
To run the project, use the following command: