lit-html
HTML template literals in JavaScript
Last updated 5 months ago by justinfagnani .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lit-html 
SYNC missed versions from official npm registry.

lit-html

Efficient, Expressive, Extensible HTML templates in JavaScript

Build Status Published on npm Join our Slack Mentioned in Awesome lit-html

Documentation

Full documentation is available at lit-html.polymer-project.org.

Docs source is in the docs folder. To build the site yourself, see the instructions in docs/README.md.

Overview

lit-html lets you write HTML templates in JavaScript with template literals.

lit-html templates are plain JavaScript and combine the familiarity of writing HTML with the power of JavaScript. lit-html takes care of efficiently rendering templates to DOM, including efficiently updating the DOM with new values.

import {html, render} from 'lit-html';

// This is a lit-html template function. It returns a lit-html template.
const helloTemplate = (name) => html`<div>Hello ${name}!</div>`;

// This renders <div>Hello Steve!</div> to the document body
render(helloTemplate('Steve'), document.body);

// This updates to <div>Hello Kevin!</div>, but only updates the ${name} part
render(helloTemplate('Kevin'), document.body);

lit-html provides two main exports:

  • html: A JavaScript template tag used to produce a TemplateResult, which is a container for a template, and the values that should populate the template.
  • render(): A function that renders a TemplateResult to a DOM container, such as an element or shadow root.

Installation

$ npm install lit-html

Contributing

Please see CONTRIBUTING.md.

Current Tags

  • 1.0.1-dev.58f394e                                ...           dev (2 years ago)
  • 1.3.0                                ...           latest (5 months ago)
  • 1.3.0-pre.1                                ...           next (6 months ago)
  • 2.0.0-pre.5                                ...           next-major (a month ago)

52 Versions

  • 2.0.0-pre.5                                ...           a month ago
  • 2.0.0-pre.4                                ...           a month ago
  • 2.0.0-pre.3                                ...           4 months ago
  • 2.0.0-pre.2                                ...           4 months ago
  • 2.0.0-pre.1                                ...           4 months ago
  • 1.3.0                                ...           5 months ago
  • 1.3.0-pre.1                                ...           6 months ago
  • 1.2.1                                ...           10 months ago
  • 1.2.0                                ...           10 months ago
  • 1.2.0-pre.1                                ...           10 months ago
  • 1.1.2                                ...           a year ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1-dev.58f394e                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 1.0.0-dev.c8753bc                                ...           2 years ago
  • 1.0.0-rc.2                                ...           2 years ago
  • 1.0.0-rc.1                                ...           2 years ago
  • 0.14.0                                ...           2 years ago
  • 0.13.0                                ...           2 years ago
  • 0.12.0                                ...           2 years ago
  • 0.11.4                                ...           2 years ago
  • 0.11.3                                ...           2 years ago
  • 0.11.2                                ...           2 years ago
  • 0.11.1                                ...           2 years ago
  • 0.11.0                                ...           2 years ago
  • 0.11.0-dev.3                                ...           2 years ago
  • 0.11.0-dev.2                                ...           2 years ago
  • 0.11.0-dev.1                                ...           2 years ago
  • 0.10.2                                ...           3 years ago
  • 0.10.1                                ...           3 years ago
  • 0.10.0                                ...           3 years ago
  • 0.9.0                                ...           3 years ago
  • 0.8.0                                ...           3 years ago
  • 0.8.0-pre.1                                ...           3 years ago
  • 0.7.1                                ...           3 years ago
  • 0.7.0                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.6.0-pre.3                                ...           3 years ago
  • 0.6.0-pre.2                                ...           3 years ago
  • 0.6.0-pre.1                                ...           3 years ago
  • 0.5.0                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.6                                ...           3 years ago
  • 0.2.5                                ...           4 years ago
  • 0.2.4                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Downloads
Today 4
This Week 116
This Month 1,007
Last Day 49
Last Week 389
Last Month 2,038
Dependencies (0)
None
Dependents (1533)

Copyright 2014 - 2017 © taobao.org |