Create HTML templates using HTM
npm install htmplate


!types

Create HTML templates using HTM (HyperScript Tagged Markup).
``js
import { template, use } from 'htmplate'
const tmpl = template
document.body.appendChild(use(tmpl))
`
š Try it out!
Installation
On node:
`bash
npm i htmplate
`
In the browser:
`js
import { template, use } from 'https://esm.sh/htmplate'
`
Usage
š Define HTML templates using a JSX-like syntax:
`js
const tmpl = template
`The syntax is powered by HTM, so you get bonuses such as self-closing tags (
), components (<${Foo}/>), syntax-highlighting (e.g. this VSCode plugin, though requires additional configuration), etc. See HTM's docs for more info.š Use HTM templates (whether defined using
template or not) to create elements:
`js
document.body.appendChild(use(tmpl))
``