Requirement: Display a calendar with a Month view on SharePoint Online home page.
How to add calendar web part in SharePoint Online modern page?
Although we have the events web part, it’s not giving a calendar look and feel, but it gets all upcoming events. So, to display a calendar grid view in SharePoint Online, you can use the Embed web part with iFrame pointing to the calendar view. Follow these steps to add the calendar to SharePoint Online modern page:
- Navigate to the page where you would like to add calendar web part, such as Home page.
- Edit the page and add an “Embed” web part to it and click on “Add embed code”.
- Use this below format to display the calendar to any modern SharePoint Online page. Change the URL accordingly. You can adjust the height and width parameters as well.
<iframe src="https://Crescent.sharepoint.com/sites/Projects/Lists/Events/calendar.aspx?isDlg=1" width="100%" height="500"></iframe>
Here, I have used the “isDlg=1” parameter to hide the page’s left navigation, top navigation, and other elements.
After adjusting some parameters and adding bit style to the embed code, here is the calendar web part on SharePoint Online page:
<iframe src="https://crescent.sharepoint.com/sites/Projects/Lists/Events/calendar.aspx?isDlg=1" scrolling="no" style="margin-top: -130px;" width="100%" height="100%"></iframe>