3.2.1 • Published 2 months ago

lit-html v3.2.1

Weekly downloads
194,188
License
BSD-3-Clause
Repository
github
Last release
2 months ago

lit-html 2.0

Efficient, Expressive, Extensible HTML templates in JavaScript

Build Status Published on npm Join our Discord Mentioned in Awesome Lit

lit-html is the template system that powers the Lit library for building fast web components. When using lit-html to develop web components, most users should import lit-html via the lit package rather than installing and importing from lit-html directly.

About this release

This is a pre-release of Lit 3.0, the next major version of Lit.

Lit 3.0 has very few breaking changes from Lit 2.0:

  • Drops support for IE11
  • Published as ES2021
  • Removes a couple of deprecated Lit 1.x APIs

Lit 3.0 should require no changes to upgrade from Lit 2.0 for the vast majority of users. Once the full release is published, most apps and libraries will be able to extend their npm version ranges to include both 2.x and 3.x, like "^2.7.0 || ^3.0.0".

Lit 2.x and 3.0 are interoperable: templates, base classes, directives, decorators, etc., from one version of Lit will work with those from another.

Please file any issues you find on our issue tracker.

Documentation

Full documentation is available at lit.dev.

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

Or use from lit:

$ npm install lit

Contributing

Please see CONTRIBUTING.md.

@brightspace-ui-labs/input-durationcontexjsbktinitialyzer-dstree-view-tester@crossfields/puzzle-elementsbadrc-bookshelfwc@toureholder/wiz-button@glade-software/glade-componentplaytwo-core-cms-sections@api-modeling/modeling-iconsyidozz-components-libraryvocabulaketiny-stepperm2a-ui-libraryorxe-directives-sdk@kr05/tiny-stepperbf-formsmetal-elementsoauth-button@prng-design/pickercovid19-chatbot-messagelit-html-input-synccovid19-chatbot@api-modeling/modeling-project-ui@klaudhaus/lit-applit-impixe-chat-botai-block@hydecorp/clap-buttonia-menu-sliderzipcan-component@teipublisher/pb-components7dbp-file-handlingmac-my-componentpuzzle-elementspuzzle-steps@zooroyal/car-windowtpit-imgwc-rough-notation@tpit/tp-form@simplr-wc/list@simplr-wc/date-input@simplr-wc/formcupon-ds-kit@simplr-wc/container@simplr-wc/data-table@simplr-wc/email-input@simplr-wc/fab@simplr-wc/grid@simplr-wc/icon@simplr-wc/icon-button@simplr-wc/info-button@simplr-wc/input-base@simplr-wc/number-input@simplr-wc/password-input@simplr-wc/radio-group@simplr-wc/select@simplr-wc/snackbar@simplr-wc/text-input@simplr-wc/textarea@simplr-wc/top-app-bar@nymbus/coreweb-wcsimplr-components@a-squared/wc@moderno/workbenchsumaq-web-components@polygonui/wc-button@platform6/componentsbriolink-ui-kitgenk-format-date-agrodriguezsdot-rapidocvaltio-element-vite@netzoio/web-componentscarii-job-board@m2fw/dialog@m2fw/tableresize-observer-temp@zeainc/deleteme@web-inmars/button@web-inmars/checkbox@web-inmars/grid@web-inmars/icon@web-inmars/radio-button@web-inmars/text-fieldcommon-check-widget@webinmars/mars-button@webinmars/mars-textarea@webinmars/mars-textfield@webinmars/radio-button@webinmars/checkbox@webinmars/grid@webinmars/iconjinselabel@webinmars/core@mayshowumioplo/footer@bliss-design-system/label@mbsmebye/boligmappa-test@mbsmebye/wc-auth
3.2.1

2 months ago

3.2.0

4 months ago

3.1.4

6 months ago

3.1.3

7 months ago

3.1.2

10 months ago

3.1.1

11 months ago

3.1.0

1 year ago

3.0.0-pre.1

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.8.0

1 year ago

2.7.5

1 year ago

3.0.0-pre.0

2 years ago

2.7.4

2 years ago

2.7.3

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.7.0

2 years ago

2.7.2

2 years ago

2.7.1

2 years ago

2.5.0

2 years ago

2.4.0

2 years ago

2.2.5

2 years ago

2.2.4

3 years ago

2.2.7

2 years ago

2.2.6

2 years ago

2.3.0

2 years ago

2.3.0-next.1

2 years ago

2.3.1

2 years ago

2.3.0-next.0

2 years ago

2.2.3

3 years ago

2.2.1

3 years ago

2.2.2

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.3

3 years ago

2.1.0

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-rc.5

3 years ago

2.0.0-rc.4

3 years ago

1.4.1

4 years ago

1.4.0

4 years ago

2.0.0-rc.2

4 years ago

2.0.0-rc.3

4 years ago

2.0.0-rc.1

4 years ago

2.0.0-pre.7

4 years ago

2.0.0-pre.6

4 years ago

2.0.0-pre.5

4 years ago

2.0.0-pre.4

4 years ago

2.0.0-pre.1

4 years ago

2.0.0-pre.3

4 years ago

2.0.0-pre.2

4 years ago

1.3.0

4 years ago

1.3.0-pre.1

4 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.2.0-pre.1

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.0

6 years ago

1.0.0-rc.2

6 years ago

1.0.0-rc.1

6 years ago

0.14.0

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.4

6 years ago

0.11.3

6 years ago

0.11.2

6 years ago

0.11.1

6 years ago

0.11.0

6 years ago

0.11.0-dev.3

6 years ago

0.11.0-dev.2

6 years ago

0.11.0-dev.1

6 years ago

0.10.2

6 years ago

0.10.1

6 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.8.0-pre.1

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.6.0-pre.3

7 years ago

0.6.0-pre.2

7 years ago

0.6.0-pre.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago