# Event Calendar: How to use different layouts on desktop and mobile

**URL:** <https://community.elfsight.com/t/event-calendar-how-to-use-different-layouts-on-desktop-and-mobile/174543>\
**Category:** Pro Tips\
**Tags:** event-calendar\
**Created:** [September 17, 2026, 6:32pm UTC](https://community.elfsight.com/t/event-calendar-how-to-use-different-layouts-on-desktop-and-mobile/174543 "2026-09-17T18:32:02Z")\
**Posts on this page:** 4\
**Page:** 1

<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 17, 2026, 6:32pm UTC](https://community.elfsight.com/t/event-calendar-how-to-use-different-layouts-on-desktop-and-mobile/174543/1 "2026-09-17T18:32:02Z")

</div>

Want to use one [Event Calendar](https://elfsight.com/event-calendar-widget/) layout on desktop and a different one on mobile? Here’s how you can do it 👇

1. First, choose the layout you’d like to use for desktop in the widget settings.

2. Then, replace your default Event Calendar installation code on your website with the following script:

```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>

```

Before using the script:

- Replace `YOUR_WIDGET_ID` (line 2) with your actual [widget ID](https://help.elfsight.com/article/1219-where-to-get-your-widget-id-in-new-dashboard).
- Replace `list` (line 3) with the layout you’d like to use on mobile.

That’s it! Your Event Calendar will now display different layouts depending on the visitor’s device ✨

  

> Was this solution helpful? Let us know in the comments 😉

---

<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:** [November 9, 2026, 7:43pm UTC](https://community.elfsight.com/t/event-calendar-how-to-use-different-layouts-on-desktop-and-mobile/174543/2 "2026-11-09T19:43:03Z")

</div>

Split this topic on November 9, 2026, 7:43pm UTC

2 posts were merged into an existing topic: [Make Event Calendar month view mobile-responsive](https://community.elfsight.com/t/make-event-calendar-month-view-mobile-responsive/178705/6)

---

<div class="post-metadata">

**Author:** ![vglockwood](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/vglockwood/32/109732_2.png) [@vglockwood](https://community.elfsight.com/u/vglockwood)\
**Post date:** [November 17, 2026, 6:52pm UTC](https://community.elfsight.com/t/event-calendar-how-to-use-different-layouts-on-desktop-and-mobile/174543/3 "2026-11-17T18:52:24Z")

</div>

> [@Max](#):
>
> 1. replace your default Event Calendar installation code with the following script

I’m not a programmer - where would I do this? Where can I find the installation code for just the mobile app?

---

<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:** [November 18, 2026, 10:23am UTC](https://community.elfsight.com/t/event-calendar-how-to-use-different-layouts-on-desktop-and-mobile/174543/4 "2026-11-18T10:23:16Z")

</div>

You should use this script on your website. Just remove the default Event Calendar installation code and use the new script instead.

Before adding the new code on your website, don’t forget to:

- Replace `YOUR_WIDGET_ID` (line 2) with your actual [widget ID](https://help.elfsight.com/article/1219-where-to-get-your-widget-id-in-new-dashboard).

- Replace `list` (line 3) with the layout you’d like to use on mobile.

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