Gathering detailed insights and metrics for lit-html
Gathering detailed insights and metrics for lit-html
Gathering detailed insights and metrics for lit-html
Gathering detailed insights and metrics for lit-html
Lit is a simple library for building fast, lightweight web components.
npm install lit-html
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
82.2
Quality
90
Maintenance
100
Vulnerability
100
License
lit-element@4.2.1
Updated on Jul 11, 2025
@lit-labs/virtualizer@2.1.1
Updated on Jul 11, 2025
@lit/react@1.0.8
Updated on Jul 11, 2025
@lit/reactive-element@2.1.1
Updated on Jul 11, 2025
@lit-labs/signals@0.1.3
Updated on Jul 11, 2025
@lit/task@1.0.3
Updated on Jul 11, 2025
TypeScript (58.93%)
JavaScript (38.48%)
HTML (2.19%)
CSS (0.23%)
Vue (0.17%)
Shell (0.01%)
Total Downloads
340,187,902
Last Day
132,743
Last Week
3,064,959
Last Month
12,919,980
Last Year
133,442,248
BSD-3-Clause License
19,993 Stars
2,572 Commits
982 Forks
212 Watchers
218 Branches
194 Contributors
Updated on Jul 30, 2025
Latest Version
3.3.1
Package Id
lit-html@3.3.1
Unpacked Size
1.63 MB
Size
306.43 kB
File Count
363
NPM Version
10.8.2
Node Version
20.19.3
Published on
Jul 11, 2025
Cumulative downloads
Total Downloads
Last Day
10.8%
132,743
Compared to previous day
Last Week
-1.7%
3,064,959
Compared to previous week
Last Month
1.6%
12,919,980
Compared to previous month
Last Year
29.7%
133,442,248
Compared to previous year
Efficient, Expressive, Extensible HTML templates in JavaScript
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.
Full documentation is available at lit.dev/docs/templates/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.
1import {html, render} from 'lit-html'; 2 3// This is a lit-html template function. It returns a lit-html template. 4const helloTemplate = (name) => html`<div>Hello ${name}!</div>`; 5 6// This renders <div>Hello Steve!</div> to the document body 7render(helloTemplate('Steve'), document.body); 8 9// This updates to <div>Hello Kevin!</div>, but only updates the ${name} part 10render(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.1$ npm install lit-html
Or use from lit
:
1$ npm install lit
Please see CONTRIBUTING.md.
No vulnerabilities found.