Overview
The inspiration for the template engine was the lit-html library, but the implementation is different and it follows own conventions.
The engine provides html
and svg
functions for defining templates (both have the same interface, but svg
uses SVG namespace). They use tagged template literals syntax to create DOM and update dynamic parts leaving static content untouched.
For the best development experience, check if your code editor supports highlighting HTML in tagged template literals.
html
arguments:
HTML content as a template content
value
- dynamic values as a property values or element content
returns:
an update function, which takes
host
andtarget
arguments
svg
arguments:
SVG content as a template content
value
- dynamic values as a property values or element content
returns:
an update function, which takes
host
andtarget
arguments
<svg>
container element has to be created with html
function. Use svg
function only for creating internal structure of the <svg>
element.
Last updated