> For the complete documentation index, see [llms.txt](https://normal-tangerine8609.gitbook.io/html-widget/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://normal-tangerine8609.gitbook.io/html-widget/template/templates.md).

# Templates

With the recent 5.0 release, users are encouraged to make their own add-ons through the template process. This allows you to make complex elements usable with only a single tag. Templates are added to HTML Widget in the same way add-ons are (see [add-ons](/html-widget/add-ons/add-ons.md)) but without importing the file as you will create the template in the same file (if you choose, you can still make it as a module).

### Basic Add-on

```javascript
const tagName = {
  mapping: {},
  async render(template, styles, attrs, innerText) {
    await template(``);
  },
};
```

This piece of code declares the template substituted whenever the `tagName` tag is used.
