# Display Month calendar on desktop, List on mobile

**URL:** <https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289>\
**Category:** Customization\
**Tags:** event-calendar\
**Created:** [September 15, 2026, 12:17pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289 "2026-09-15T12:17:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monmouth\_Fish\_Game](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/monmouth_fish_game/32/105565_2.png) [@Monmouth\_Fish\_Game](https://community.elfsight.com/u/Monmouth_Fish_Game)\
**Post date:** [September 15, 2026, 12:17pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289/1 "2026-09-15T12:17:35Z")

</div>

I’m currently using the Elfsight Event Calendar widget on our website and would like to configure the calendar so that it displays differently depending on the visitor’s device.

Ideally, I would like:

- **Desktop/Tablet:** Display the traditional **Month Calendar/Grid View**
- **Mobile:** Automatically switch to the **List/Agenda View**

Is there a way to configure the Event Calendar widget so that the view changes automatically based on screen size?

If this isn’t available through the standard widget settings, can it be accomplished with custom CSS, JavaScript, or another recommended method?

I’d appreciate any instructions or sample code you can provide.

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [September 15, 2026, 12:29pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289/3 "2026-09-15T12:29:08Z")

</div>

Hi there, @Monmouth_Fish_Game 👋

To implement this functionality, you should replace the default installation code of the widget with the custom one:

```auto
<script>
	const WIDGET_ID = 'YOUR_WIDGET_ID';
	const MOBILE_LAYOUT = 'list';
	const MOBILE_BREAKPOINT = 680;
	if (
		!document.querySelector('script\[src="https://elfsightcdn.com/platform.js"\]')
	) {
		const script = document.createElement('script');
		script.src = 'https://elfsightcdn.com/platform.js';
		script.async = true;
		document.head.appendChild(script);
	}
	const widget = document.createElement('div');
	widget.className = \`elfsight-app-${WIDGET_ID}\`;
	widget.setAttribute('data-elfsight-app-lazy', '');
	if (window.innerWidth < MOBILE_BREAKPOINT) {
		widget.setAttribute('data-elfsight-app-layout', MOBILE_LAYOUT);
	}
	document.currentScript.after(widget);
</script>

```

Replace `YOUR_WIDGET_ID` in the **1st** line of the code with the actual [ID of your widget](https://help.elfsight.com/article/1219-where-to-get-your-widget-id-in-new-dashboard) and add the resulted code to your website.

GIve it a try and let me know if it helped 🙂

---

<div class="post-metadata">

**Author:** ![Monmouth\_Fish\_Game](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/monmouth_fish_game/32/105565_2.png) [@Monmouth\_Fish\_Game](https://community.elfsight.com/u/Monmouth_Fish_Game)\
**Post date:** [September 15, 2026, 1:14pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289/4 "2026-09-15T13:14:25Z")

</div>

> [@Max](#):
>
> ```auto
> <script>
> const WIDGET_ID = 'YOUR_WIDGET_ID';
> const MOBILE_LAYOUT = 'list';
> const MOBILE_BREAKPOINT = 680;
> if (
> !document.querySelector('script\[src="https://elfsightcdn.com/platform.js"\]')
> ) {
> const script = document.createElement('script');
> script.src = 'https://elfsightcdn.com/platform.js';
> script.async = true;
> document.head.appendChild(script);
> }
> const widget = document.createElement('div');
> widget.className = \`elfsight-app-${WIDGET_ID}\`;
> widget.setAttribute('data-elfsight-app-lazy', '');
> if (window.innerWidth < MOBILE_BREAKPOINT) {
> widget.setAttribute('data-elfsight-app-layout', MOBILE_LAYOUT);
> }
> document.currentScript.after(widget);
> </script>
> 
> ```

Thanks Max…but I’m getting this when I installing. Thoughts?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/9/2/929e6a8b6ddf0695e58eb11a64020ce5d067c01c.png)

Unexpected:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/5/4/54b723f548f8ac66146bf53133b2bd3e1b51e4d7.png)

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [September 15, 2026, 1:23pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289/5 "2026-09-15T13:23:01Z")

</div>

Sorry for the oversight, some additional symbols have been added after pasting the code:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/2/3/23d9726685575776255f52dee66575c1e3cf25e1.png)

  

Please try to use this version and let me know how it worked:

```auto
<script>
	const WIDGET_ID = 'YOUR_WIDGET_ID';
	const MOBILE_LAYOUT = 'list';
	const MOBILE_BREAKPOINT = 600;
	if (
		!document.querySelector('script[src="https://elfsightcdn.com/platform.js"]')
	) {
		const script = document.createElement('script');
		script.src = 'https://elfsightcdn.com/platform.js';
		script.async = true;
		document.head.appendChild(script);
	}
	const widget = document.createElement('div');
	widget.className = `elfsight-app-${WIDGET_ID}`;
	widget.setAttribute('data-elfsight-app-lazy', '');
	if (window.innerWidth < MOBILE_BREAKPOINT) {
		widget.setAttribute('data-elfsight-app-layout', MOBILE_LAYOUT);
	}
	document.currentScript.after(widget);
</script>

```

---

<div class="post-metadata">

**Author:** ![Monmouth\_Fish\_Game](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/monmouth_fish_game/32/105565_2.png) [@Monmouth\_Fish\_Game](https://community.elfsight.com/u/Monmouth_Fish_Game)\
**Post date:** [September 15, 2026, 1:53pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289/6 "2026-09-15T13:53:32Z")

</div>

OK..pasted code with widget ID and I’m not seeing the widget at all in either desktop or mobile view.

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [September 15, 2026, 2:52pm UTC](https://community.elfsight.com/t/display-month-calendar-on-desktop-list-on-mobile/174289/7 "2026-09-15T14:52:39Z")

</div>

It seems that you’ve pressed Enter when pasting the widget ID which broke the script.

I’ll send to you the script with the correctly added ID in a personal message 🙂
