> For the complete documentation index, see [llms.txt](https://docs.stixgames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stixgames.com/text-animations/templates.md).

# Templates

Templates can be used to create shortcuts or presets for multiple tags. You define a new tag that gets replaced by some other tags before the text is processed by the animated text element.

<figure><img src="https://101455922-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsXRHzPpSiweEUfocjZwl%2Fuploads%2FF5AZFbYgTqeCxOhN3jhc%2FTemplate%20Example.png?alt=media&amp;token=31ba52ff-15c1-4e62-a42c-56a147498af8" alt=""><figcaption><p>Templates can be found in the General section of your Text Animation Settings</p></figcaption></figure>

The replacement is done in a pre-processing step via string replacement. It's simple but powerful.

## Example

Let's start with a template like this:

| Property    | Value                      |
| ----------- | -------------------------- |
| Tag         | angry                      |
| Opening Tag | \<b>\<color="red">\<shake> |
| Closing Tag | \</shake>\</color>\</b>    |

If you use the tag like this:

`Hey, I'm a <angry>very angry</angry> character! I bet you're <wiggle>scared</wiggle>.`&#x20;

The `<angry>` and `</angry>` tags will be replaced like this:

`Hey, I'm a <b><color="red"><shake>very angry</shake></color></b> character! I bet you're <wiggle>scared</wiggle>.`&#x20;

Very intimidating. Since it's just string replacement, you can add any tags you want. Rich text tags, built-in animation tags, custom animations, etc.

{% hint style="info" %}
If you want to go crazy, you could even include template tags *inside* other style tags, but it will only work with some extra care: Each style is only replaced **once**. They get executed sequentially. That means if your first style contains a tag for your second style, the replaced tags will get replaced too, but it won't work the other way around.
{% endhint %}
