> For the complete documentation index, see [llms.txt](https://docs.keycloakify.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keycloakify.dev/features/integrating-an-existing-theme-into-your-keycloakify-project.md).

# Integrating an Existing Theme into Your Keycloakify Project

If you have already created a Keycloak theme using the native theming system, you can easily import it into your Keycloakify project.

This process is straightforward and requires no special configuration. Simply copy the source files of your existing theme and place them into the `src` directory of your Keycloakify project.

<figure><img src="/files/7DxUDHAUG51wU1tYSJjm" alt="Native login theme in a Keycloakify project"><figcaption><p>Screenshot showing a native login theme inside a Keycloakify project</p></figcaption></figure>

Below is a live demonstration using a login theme, but the same process applies to any type of theme.

{% embed url="<https://youtu.be/OFg9RIM5hSw>" %}

## Theme Variants Support

If your project includes theme variants, they will also work seamlessly with your imported native theme.

You can leverage a special FreeMarker variable in your `.ftl` files to display the active theme variant dynamically:

{% code title="src/login/login.ftl" %}

```ftl
<h1>${xKeycloakify.themeName}</h1>
```

{% endcode %}

To customize translations based on the active theme variant, create property files with the following naming pattern:

```
messages/messages_<language>_override_<theme name>.properties
```

For example, if you have theme variants named `vanilla` and `chocolate`, you can override the `loginAccountTitle` message key for each variant. Here's an example project structure:

<figure><img src="/files/AngWpqpVlkV38bJNle1k" alt="Theme variants: vanilla and chocolate"><figcaption><p>A project with two theme variants, "vanilla" and "chocolate," where the <code>loginAccountTitle</code> message key is overridden for each variant.</p></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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.keycloakify.dev/features/integrating-an-existing-theme-into-your-keycloakify-project.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
