lit-html
HTML template literals in JavaScript
Last updated 5 months ago by straversi .
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 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 youself, 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 (8 months ago)
  • 1.1.2                                ...           latest (5 months ago)
  • 1.0.0                                ...           next (a year ago)

42 Versions

  • 1.1.2                                ...           5 months ago
  • 1.1.1                                ...           6 months ago
  • 1.1.0                                ...           8 months ago
  • 1.0.1-dev.58f394e                                ...           8 months ago
  • 1.0.0                                ...           a year ago
  • 1.0.0-dev.c8753bc                                ...           a year ago
  • 1.0.0-rc.2                                ...           a year ago
  • 1.0.0-rc.1                                ...           a year ago
  • 0.14.0                                ...           a year ago
  • 0.13.0                                ...           a year ago
  • 0.12.0                                ...           a year ago
  • 0.11.4                                ...           a year ago
  • 0.11.3                                ...           a year ago
  • 0.11.2                                ...           a year ago
  • 0.11.1                                ...           a year ago
  • 0.11.0                                ...           a year ago
  • 0.11.0-dev.3                                ...           a year ago
  • 0.11.0-dev.2                                ...           a year ago
  • 0.11.0-dev.1                                ...           a year ago
  • 0.10.2                                ...           2 years ago
  • 0.10.1                                ...           2 years ago
  • 0.10.0                                ...           2 years ago
  • 0.9.0                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.8.0-pre.1                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.6.0-pre.3                                ...           2 years ago
  • 0.6.0-pre.2                                ...           2 years ago
  • 0.6.0-pre.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.6                                ...           2 years ago
  • 0.2.5                                ...           3 years ago
  • 0.2.4                                ...           3 years ago
  • 0.2.3                                ...           3 years ago
  • 0.2.2                                ...           3 years ago
  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Downloads
Today 45
This Week 125
This Month 584
Last Day 1
Last Week 143
Last Month 706
Dependencies (0)
None
Dev Dependencies (17)
Dependents (755)

Copyright 2014 - 2017 © taobao.org |