> For the complete documentation index, see [llms.txt](https://docs.horizon.ipaper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.horizon.ipaper.io/horizon-experience/custom-elements.md).

# Custom elements

How to add custom elements to an embedded Horizon experience

Horizon supports the use of custom elements in an embedded experience, which can be useful for maintaining a consistent user interface across your website. These elements can be anything from an image, SVG, text, HTML markup, etc., so they are easily customizable.

### Loading

You can add a custom loading element which will be displayed while the Horizon experience is loading. Simply add your element inside the Horizon web component with the attribute `slot="loading"`:

```html
<ip-embed-leaflet alias="[ACCOUNT_NAME]/[ALIAS]">
    <p slot="loading">Loading...</p>
</ip-embed-leaflet>
```

### Error

You can add a custom error element which will be displayed when an error occurs in the Horizon experience. Simply add your element inside the Horizon web component with the attribute `slot="error"`:

```html
<ip-embed-leaflet alias="[ACCOUNT_NAME]/[ALIAS]">
    <p slot="error">An error has occured!</p>
</ip-embed-leaflet>
```

***

## Examples

Here are some more examples of custom elements.

### Image

```html
<ip-embed-leaflet alias="[ACCOUNT_NAME]/[ALIAS]">
    <img src="loading.gif" slot="loading"></div>
</ip-embed-leaflet>
```

<figure><img src="https://2666012125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTiKkO2apMzIcxKwKiV1%2Fuploads%2FaSnj8zFUVerGwHmVefV3%2Floader.gif?alt=media&amp;token=c209489e-3af6-4018-b73d-51590dad4db1" alt=""><figcaption></figcaption></figure>

### HTML markup and styling:

```html
<ip-embed-leaflet alias="[ACCOUNT_NAME]/[ALIAS]">
    <div slot="error">
        <h1 style="color: red;">Error</h1>
        <p>An unexpected error has occured!</p>
    </div>
</ip-embed-leaflet>
```

<figure><img src="https://2666012125-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTiKkO2apMzIcxKwKiV1%2Fuploads%2FaGDBolKJGppU5uLAiOAD%2FCapture.PNG?alt=media&amp;token=550a632a-a9a3-4d7d-a699-057f5fa45967" alt=""><figcaption></figcaption></figure>


---

# 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://docs.horizon.ipaper.io/horizon-experience/custom-elements.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.
