Wednesday, July 24, 2024

Reactjs FullCalendar open Sweetalert on dayclick

Reactjs FullCalendar open Sweetalert on dayclick

Hello to all, welcome to In this post, I will tell you, Reactjs FullCalendar open Sweetalert on dayclick.

Reactjs full-calendar working

Post Working:

Friends, in this post, I am opening sweetalert modal popup on dayclick fullcalendar event into my reactjs application. In this working post I have used fullcalendar, reactjs, sweetalert latest versions.

Here you can check more posts related fullcalendar with other programming languages:

Fullcalendar Multiple Uses

Here is the working code snippet and please use carefully:

1. Firstly, we need to get fresh react set and for this we need to run below commands into our terminal and make sure, we should have latest node installed in my our system: 

npx create-react-app therichpost

cd therichpost

npm start


2. Now we need to run below commands to get fullcalendar and sweetlaert modules into our reactjs app:

npm install --save @fullcalendar/react @fullcalendar/daygrid

npm i @fullcalendar/interaction

npm install sweetalert2-react

npm start //start the application


3. Finally, we need to add below code into our src/App.js file to get fullcalendar and its events working:

//Fullcalendar, Sweetalert modules imported
import FullCalendar from '@fullcalendar/react'
import dayGridPlugin from '@fullcalendar/daygrid'
import interactionPlugin from "@fullcalendar/interaction"; // needed for dayClick
import Swal from 'sweetalert2'

function App() {
  return (
    <div className="App">
        <h1>Reactjs FullCalendar Working Example</h1>
          plugins={[ dayGridPlugin, interactionPlugin ]}

          //Dayclick open sweetalert
          dateClick={function(arg) {
              title: 'Date',
              text: arg.dateStr,
              type: 'success',
            { title: 'event 1', date: '2020-07-01' },
            { title: 'event 2', date: '2020-07-02' }


This is it friends and if you have any kind of query then please do comment below. Also please share your views on this post.

After this, I will come with reactjs fullcalender more posts and if you have any kind of suggestion or requirement then can comment below.



the authortherichpost
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.