import {html, render} from 'lit-html';
// A lit-html template uses the `html` template tag:
let sayHello = (name) => html`<h1>Hello ${name}</h1>`;
// It's rendered with the `render()` function:
render(sayHello('World'), document.body);
// And re-renders only update the data that changed, without VDOM diffing!
render(sayHello('Everyone'), document.body);
lit-html is extremely fast. It uses fast platform features like HTML <template>
elements with native cloning.
Unlike VDOM libraries, lit-html only ever updates the parts of templates that actually change - it doesn’t re-render the entire view.
lit-html gives you the full power of JavaScript and functional programming patterns.
Templates are values that can be computed, passed to and from functions and nested. Expressions are real JavaScript and can include anything you need.
lit-html supports many kind of values natively: strings, DOM nodes, heterogeneous lists, nested templates and more.
lit-html is extremely customizable and extensible. Directives customize how values are handled, allowing for asynchronous values, efficient keyed-repeats, error boundaries, and more. lit-html is like your very own template construction kit.