Introduction
In this article, I will explain how to create FullCalendar in a ReactJS application.
Prerequisites
- Knowledge of ReactJS
- Visual Studio Code Installed
- Node and NPM installed
Create a React.js Project
To create a new ReactJS project, open the command prompt and enter the following command.
- npx create-react-app reactpartone
Now install fullcalendar using the following commands
- npm install @fullcalendar/core
- npm install @fullcalendar/react @fullcalendar/daygrid
- npm install @fullcalendar/timegrid
Now install Bootstrap in this project by using the following command.
- npm install --save bootstrap
Now, open the index.js file and add Bootstrap reference.
- import 'bootstrap/dist/css/bootstrap.min.css';
Now go to src folder and create a new component 'Calendar.js' and add the following reference for fullcalendar plugin,
- import "@fullcalendar/core/main.css";
- import "@fullcalendar/daygrid/main.css";
- import FullCalendar from "@fullcalendar/react";
- import dayGridPlugin from "@fullcalendar/daygrid";
Now add the following code in this component
- import React, { Component } from 'react'
- import "@fullcalendar/core/main.css";
- import "@fullcalendar/daygrid/main.css";
- import FullCalendar from "@fullcalendar/react";
- import dayGridPlugin from "@fullcalendar/daygrid";
- const events = [{ title: "Today", date: new Date() }];
- export class Calendar extends Component {
- render() {
- return (
- <div className="container">
- <div className="row title" style={{ marginTop: "20px" }} >
- <div class="col-sm-12 btn btn-info">
- FullCalendar In React Application
- </div>
- </div>
- <FullCalendar
- defaultView="dayGridMonth"
- plugins={[dayGridPlugin]}
- events={events}
- />
- </div>
- )
- }
- }
- export default Calendar
Now open App.js file and add the following code,




Join the conversation! Your thoughts help the community grow.