> For the complete documentation index, see [llms.txt](https://help.mimeeq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.mimeeq.com/developer-guides/custom-loader.md).

# Custom Loader

Show your own branded loading animation while the configurator starts. See working CodePen examples and a breakdown of the code you need.

Do you want to use your own custom loader while Mimeeq loads its configurator? To make the process easy, we have provided full code examples below.

{% hint style="warning" %}
This only works on Standard and Hybrid Modular configurators. It will not work for Full Modular configurators, as they have a different logic. For product lists, use the `mimeeq-product-list-initialized` event instead of `mimeeq-3d-product-initialized`.
{% endhint %}

[Check here for a breakdown of the code](#code-breakdown-for-single-product)

***

## Examples

{% tabs %}
{% tab title="Single product" %}
{% embed url="<https://codepen.io/mimeeq/embed/NWmvgRy/328f6da2e509a25f5ec5eaf25f28ef9c?default-tab=>" %}
CODEPEN CUSTOM LOADER CONFIGURATOR EXAMPLE
{% endembed %}
{% endtab %}

{% tab title="Product list" %}
{% embed url="<https://codepen.io/mimeeq/embed/abxLvNx/d34b371686ddddcd43167afbd622f60f?default-tab=>" %}
CODEPEN CUSTOM LOADER PRODUCT LIST EXAMPLE
{% endembed %}
{% endtab %}

{% tab title="Product list with skeleton loader" %}
{% embed url="<https://codepen.io/mimeeq/embed/GggXwaw/30b1d32d487acc69eac1b7b07643f2f3?default-tab=>" %}
CODEPEN CUSTOM LOADER PRODUCT LIST EXAMPLE WITH SKELETON LOADER
{% endembed %}
{% endtab %}
{% endtabs %}

***

## Code breakdown for single product

{% hint style="info" %}
You can also click **Edit on CodePen** to see any of the code snippets above.
{% endhint %}

![Edit on CodePen button in the embedded example](https://621103948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsqWfi8ifBhTdkvf1vOlY%2Fuploads%2FM0IISqaXdhYHbYTMZfxz%2Fedit-codepen.png?alt=media)

{% stepper %}
{% step %}

### Add the embed code

This is the embed code — replace it with your own:

```html
<mmq-embed short-code="U1X94N" template="Default-MDEMO" locale="en"></mmq-embed>

<script src="https://cdn.mimeeq.com/read_models/embed/app-embed.js" rel="script" type="application/javascript" async></script>
```

{% endstep %}

{% step %}

### Hide the configurator until it has initialised

This part hides our configurator until it has finished initialising:

```html
<style>
mmq-embed {
  visibility: hidden;
  opacity: 0;
}

.show {
  opacity: 1;
  visibility: visible;
}
</style>

<script>
document.addEventListener('mimeeq-3d-product-initialized', () => {
  console.log('Mimeeq product list initialized');
  const embed = document.querySelector('mmq-embed');
  embed.classList.add('show');
  const loader = document.querySelector('#loader');
  loader.remove();
});

// Add this event to the one above, when using product list
document.addEventListener('mimeeq-product-list-initialized', () => {
  const embed = document.querySelector('mmq-embed');
  embed.classList.add('show');
  const loader = document.querySelector('#loader');
  loader.remove();
});
</script>
```

{% endstep %}

{% step %}

### Add your own loader

Now just add your own loader to show while our configurator is initialising.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
That's it — you've added your own custom loader.
{% endhint %}

***

## Full example code

For reference, here is the full code used for this example:

```html
<!-- This is the Embed Script for the product -->

<mmq-embed short-code="U1X94N" template="Default-MDEMO" locale="en"></mmq-embed>

<script src="https://cdn.mimeeq.com/read_models/embed/app-embed.js" rel="script" type="application/javascript" async></script>

<!-- End Embed Script -->

<div id="loader" class="container">
	<div class="holder">
		<div class="box"></div>
	</div>
	<div class="holder">
		<div class="box"></div>
	</div>
	<div class="holder">
		<div class="box"></div>
	</div>
</div>

<style>
*, *:before, *:after {
  box-sizing: border-box;
}

.container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  perspective: 2000px;
  transform: rotateX(-30deg) rotateY(-45deg);
}

.holder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  transform: translate3d(0em, 3em, 1.5em);
}
.holder:last-child {
  transform: rotateY(-90deg) rotateX(90deg) translate3d(0, 3em, 1.5em);
}
.holder:first-child {
  transform: rotateZ(-90deg) rotateX(-90deg) translate3d(0, 3em, 1.5em);
}
.holder:nth-child(1) .box {
  background-color: #1762d4;
}
.holder:nth-child(1) .box:before {
  background-color: #0d3778;
}
.holder:nth-child(1) .box:after {
  background-color: #124da6;
}
.holder:nth-child(2) .box {
  background-color: #74A1E5;
}
.holder:nth-child(2) .box:before {
  background-color: #2669cd;
}
.holder:nth-child(2) .box:after {
  background-color: #4984dd;
}
.holder:nth-child(3) .box {
  background-color: #BAD0F3;
}
.holder:nth-child(3) .box:before {
  background-color: #6395e4;
}
.holder:nth-child(3) .box:after {
  background-color: #8fb2eb;
}

.box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  animation: ani-box 6s infinite;
  width: 3em;
  height: 3em;
}
.box:before, .box:after {
  position: absolute;
  width: 100%;
  height: 100%;
  content: "";
}
.box:before {
  left: 100%;
  bottom: 0;
  transform: rotateY(90deg);
  transform-origin: 0 50%;
}
.box:after {
  left: 0;
  bottom: 100%;
  transform: rotateX(90deg);
  transform-origin: 0 100%;
}

@keyframes ani-box {
  8.33% {
    transform: translate3d(-50%, -50%, 0) scaleZ(2);
  }
  16.7% {
    transform: translate3d(-50%, -50%, -3em) scaleZ(1);
  }
  25% {
    transform: translate3d(-50%, -100%, -3em) scaleY(2);
  }
  33.3% {
    transform: translate3d(-50%, -150%, -3em) scaleY(1);
  }
  41.7% {
    transform: translate3d(-100%, -150%, -3em) scaleX(2);
  }
  50% {
    transform: translate3d(-150%, -150%, -3em) scaleX(1);
  }
  58.3% {
    transform: translate3d(-150%, -150%, 0) scaleZ(2);
  }
  66.7% {
    transform: translate3d(-150%, -150%, 0) scaleZ(1);
  }
  75% {
    transform: translate3d(-150%, -100%, 0) scaleY(2);
  }
  83.3% {
    transform: translate3d(-150%, -50%, 0) scaleY(1);
  }
  91.7% {
    transform: translate3d(-100%, -50%, 0) scaleX(2);
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scaleX(1);
  }
}
mmq-embed {
  visibility: hidden;
  opacity: 0;
}

.show {
  opacity: 1;
  visibility: visible;
}
</style>

<script>
document.addEventListener('mimeeq-3d-product-initialized', () => {
  const embed = document.querySelector('mmq-embed');
  embed.classList.add('show');
  const loader = document.querySelector('#loader');
  loader.remove();
});
// Add this event listener, when using product list
document.addEventListener('mimeeq-product-list-initialized', () => {
  const embed = document.querySelector('mmq-embed');
  embed.classList.add('show');
  const loader = document.querySelector('#loader');
  loader.remove();
});
</script>
```

***

## Related articles

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Custom UI</strong></td><td>Build and deploy your own interface around the Mimeeq 3D configurator.</td><td><a href="/developer-guides/custom-ui.md">Custom UI</a></td></tr><tr><td><strong>Performance</strong></td><td>How Mimeeq delivers fast 3D configurators to customers worldwide.</td><td><a href="/developer-guides/performance.md">Performance</a></td></tr><tr><td><strong>Events &#x26; Tracking</strong></td><td>Use configurator events to feed your own analytics.</td><td><a href="/developer-guides/events-and-tracking.md">Events &amp; Tracking</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.mimeeq.com/developer-guides/custom-loader.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
