---
title: "Use HTML Includes in your themes"
slug: "use-html-includes-in-your-themes"
abstract: "How to use create and configure HTML Includes for SXA themes, so you can inject external HTML content onto your pages."
---
# Use HTML Includes in your themes

With HTML Includes, you can define chunks of HTML that you want to be rendered into the HTML for a page. This can give faster load times and improved maintainability, since you can use external front-end assets. You can define any HTML, and configure it to render on any of the available locations in your HTML. HTML Includes are configured for the [SXA themes](https://doc.sitecore.com/xp/en/developers/sxa/101/sitecore-experience-accelerator/the-sxa-themes.html "The SXA themes"), and you can use them both for themes that are [assigned to components](https://doc.sitecore.com/xp/en/developers/sxa/101/sitecore-experience-accelerator/assign-a-theme-to-a-component.html "Assign a theme to a component") and that are [assigned to a page](https://doc.sitecore.com/xp/en/developers/sxa/101/sitecore-experience-accelerator/assign-a-theme-to-a-page.html "Assign a theme to a page").

> [!important]
> Before using HTML Includes for a theme, make sure the HTML structure is correct, so using the HTML Includes does not break the structure of existing pages that use the theme.

<details>
<summary><h2>Create an HTML Include</h2></summary>

If you want to use HTML Includes, you must create them for the theme.

To create an HTML Include for an SXA theme:

1. In the Content Editor, navigate to the theme you want to create an HTML Include for, for example, */sitecore/media library/Themes/Basic2*.
2. Right-click on the **HTML Includes** folder, and select **HTML Include**.

    > [!tip]
    > If your theme does not already have this folder, you can create it using this template, which is available as an insert option: */sitecore/templates/Foundation/Experience Accelerator/Theming/HTML Snippets/HTML Snippets Folder*.

3. Give the include a **Name**.
4. Click **OK**.

</details>

<details>
<summary><h2>Configure an HTML Include</h2></summary>

For HTML Includes to properly render on pages using the theme, you must configure them.

To configure an HTML Include:

1. In Content Editor, navigate to the HTML Include you want to configure.
2. In the window for the HTML Include, specify the **HTML** and **Location** fields.

| Field | Description |
| --- | --- |
| HTML | The HTML content of your HTML Include, for example `link`, `script`, and `div`. |
| Location | Specifies where in the output HTML to render the HTML Include. Can be `head`, `body-top`, and `body-bottom`. |

</details>