> For the complete documentation index, see [llms.txt](https://jscula.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jscula.gitbook.io/docs/templates-and-components/loadtemplates.md).

# loadTemplates()

Templates help you reuse HTML with data.

## `loadTemplates()`

`loadTemplates()` loads external template files.

Each file should contain `<template id="...">` blocks.

#### Syntax

```javascript
await loadTemplates(paths);
```

#### Parameters

* `paths` → array of template file paths

#### Output

```javascript
Promise<void>
```

#### Template File Example

```html
<template id="user-card">
  <article class="user-card">
    <img src="{{avatar}}" alt="{{name}}">
    <h3>{{name}}</h3>
    <slot></slot>
    <slot name="actions"></slot>
  </article>
</template>
```

#### Loading The Template

```javascript
await loadTemplates([
  '/templates/user-card.tpl.html' 
]);
```

#### Key Takeaway

> `loadTemplates()` makes external templates available to **J**scula.
