---
title: "JQuery Event calendar Themes and Dark Mode Example | Mobiscroll"
component: "Event calendar"
framework: "jQuery"
library_version: "6.1.5"
url: "https://demo.mobiscroll.com/jquery/eventcalendar/themes-ios-material-windows"
---

# Themes and Dark Mode - jQuery Event calendar demo

Apply iOS, Material, or Windows themes to a JQuery event calendar — toggle light/dark mode or build a custom brand theme with the theme builder.

- [Live demo](https://demo.mobiscroll.com/jquery/eventcalendar/themes-ios-material-windows)
- [View code on GitHub](https://github.com/acidb/mobiscroll-demos-jquery/tree/main/src/demos/eventcalendar/calendar-view/themes-ios-material-windows)
- This demo in other frameworks: [JavaScript](https://demo.mobiscroll.com/javascript/eventcalendar/themes-ios-material-windows.md), [Angular](https://demo.mobiscroll.com/angular/eventcalendar/themes-ios-material-windows.md), [React](https://demo.mobiscroll.com/react/eventcalendar/themes-ios-material-windows.md), [Vue](https://demo.mobiscroll.com/vue/eventcalendar/themes-ios-material-windows.md)

## Description

The look and feel of the event calendar can be deeply customized. There are four levels of customization:

- **Base themes:** Choose between **iOS**, **Material** and **Windows**.
- **Light or dark:** Every theme has a `light` and `dark` variant. Setting the `themeVariant` to `'auto'` will switch based on system settings.
- **Custom themes:** Use the [theme builder](https://mobiscroll.com/themebuilder) to customize the colors and make it match your brand.
- **Custom CSS:** If you need further customization, the sky is the limit with CSS overrides.

You can also see how every example looks by changing the theme from the header.

## What this demo shows

- A desktop month-view event calendar is shown alongside theme controls so you can preview different calendar looks in the same layout.
- **Theme controls** A segmented picker lets you switch between the `iOS`, `Material`, and `Windows` base themes, with `iOS` selected by default.
- **Theme variant** A dark-theme switch is enabled by default, showing how the same calendar can be previewed in a dark variant.
- **Custom theme option** A separate switch for theme builder or Sass-based customization is present but turned off by default.
- **Month grid** The calendar displays a full desktop month view with event labels rendered directly inside day cells.
- **Event labels** Events use different label styles and colors to distinguish all-day events, multi-day events, and timed events.
- **Overflow handling** The number of visible event labels depends on the available height in each day cell. Additional events are collapsed behind an `X more` link.
- **Popover** Clicking the `X more` link opens a popover that shows the hidden events for that day.
- **Label interaction** Hovering over or clicking an event label selects it and highlights the selected label.
- **Day cell states for future days** Hovering a day cell highlights the day number with a gray background, while clicking the empty part of the cell selects the day and highlights the day number with a blue background.
- **Calendar header** The header shows the current month and year on the left, and blue month navigation arrows with a `Today` button (for jumping back to the current date) between them on the right. 
- **Month navigation gesture** The calendar also supports changing months by clicking and dragging the calendar left or right.

## Best for

- **Theme comparison** Evaluating how the same desktop month-view event calendar looks with the `iOS`, `Material`, and `Windows` base themes.
- **Light and dark mode previewing** Checking how a calendar setup behaves across light and dark theme variants.
- **Branded calendar experiences** Exploring how a base theme can be extended with theme builder, Sass, or custom CSS to match a product's visual style.

## Tutorial

### Pick a base theme

- (x) iOS
- ( ) Material
- ( ) Windows

### Then choose between light or dark theme variant

- [ ] Turn dark theme on

### Or build a custom theme based on any base theme

- [ ] Use the [theme builder](https://mobiscroll.com/themebuilder) or [Sass](https://mobiscroll.com/docs/jquery/eventcalendar/css-variables) to customize themes

```js
theme: 'ios',
themeVariant: 'light'
```

With "Material":

```js
theme: 'material',
themeVariant: 'light'
```

With "Windows":

```js
theme: 'windows',
themeVariant: 'light'
```

## API used in this demo

- [`view`](https://mobiscroll.com/docs/jquery/eventcalendar/api#opt-view) - option
- [`labels`](https://mobiscroll.com/docs/jquery/eventcalendar/api#opt-labels) - option
- [`setOptions`](https://mobiscroll.com/docs/jquery/eventcalendar/api#method-setOptions) - method
- [`theme`](https://mobiscroll.com/docs/jquery/eventcalendar/api#opt-theme) - option
- [`themeVariant`](https://mobiscroll.com/docs/jquery/eventcalendar/api#opt-themeVariant) - option
- [`setEvents`](https://mobiscroll.com/docs/jquery/eventcalendar/api#method-setEvents) - method

## Code

### JS

```js
$(function () {
  mobiscroll.setOptions({
  });

  var inst = $('#demo-theme')
    .mobiscroll()
    .eventcalendar({
      view: {
        calendar: { labels: true },
      },
    })
    .mobiscroll('getInst');

  $('#data-theme-select').on('change', function () {
    inst.setOptions({ theme: $(this).val() });
  });

  $('#data-theme-variant-select').on('change', function () {
    inst.setOptions({ themeVariant: $(this).val() });
  });

  $.getJSON('https://trial.mobiscroll.com/events/?vers=5&callback=?', function (events) {
    inst.setEvents(events);
  });
});
```

### HTML

```html
<div mbsc-page class="mds-full-height">
  <div class="mds-full-height mbsc-flex-col">
    <div class="mbsc-grid">
      <div class="mbsc-row">
        <div class="mbsc-col-sm-6">
          <label>
            <select id="data-theme-select" mbsc-dropdown data-input-style="box" label="Theme" data-label-style="stacked">
              <option value="auto">Auto</option>
              <option value="ios">iOS</option>
              <option value="material">Material</option>
              <option value="windows">Windows</option>
            </select>
          </label>
        </div>
        <div class="mbsc-col-sm-6">
          <label>
            <select id="data-theme-variant-select" mbsc-dropdown data-input-style="box" label="Theme variant" data-label-style="stacked">
              <option value="auto">Auto</option>
              <option value="light">Light</option>
              <option value="dark">Dark</option>
            </select>
          </label>
        </div>
      </div>
    </div>
    <div id="demo-theme" class="mbsc-flex-1-1"></div>
  </div>
</div>
```

### CSS

```css
.mds-full-height {
  height: 100%;
}
```

## Implementation notes

- Use `view: { calendar: { labels: true } }`. Pass `theme` and `themeVariant` as props to the Eventcalendar. Both default to `'auto'` - `theme: 'auto'` lets Mobiscroll pick based on the platform, `themeVariant: 'auto'` follows the OS light/dark preference.
- `theme` accepts `auto`, `ios`, `material`, `windows`. `themeVariant` accepts `auto`, `light`, `dark`. React/Angular/Vue: change either at runtime by updating the bound `theme`/`themeVariant` prop value. JS/jQuery: call `inst.setOptions({ theme: value })` / `inst.setOptions({ themeVariant: value })`.
- Load events from `https://trial.mobiscroll.com/events/?vers=5` via JSONP using `getJson(url, callback, 'jsonp')`. Angular: use `HttpClient.jsonp()` instead. JS/jQuery: call `inst.setEvents(events)` in the callback.

## Run it in your project

1. If not signed up yet, or don't own a license, you can [start a free trial](https://mobiscroll.com/starttrial).

2. Clone the repository:

   ```
   git clone https://github.com/acidb/mobiscroll-demos-jquery.git
   ```

3. If not installed yet, install the Mobiscroll CLI from NPM:

   ```
   npm install -g @mobiscroll/cli
   ```

4. Config Mobiscroll - open a terminal window in the root directory and run:

   ```
   mobiscroll config jquery
   ```

5. Install dependencies - open a terminal window in the root directory and run:

   ```
   npm install
   ```

6. Run the project:

   ```
   npm run dev
   ```

On a trial, add `--trial` to the config command: `mobiscroll config jquery --trial`.

Running a demo locally requires a Mobiscroll trial or a license; setup is per framework at https://mobiscroll.com/docs/jquery/getting-started/installation
