Requirement: Display a calendar with Month view on SharePoint Online home page.
How to add calendar web part in SharePoint online modern page?
Although we have 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 Embed web part with iFrame pointing to the calendar view. Follow these steps to add 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 “isDlg=1” parameter to hide the left navigation, top navigation and other elements from the page.
After adjusting some parameters and adding bit style to the embed code, here is the calendar web part in 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>