Gathering detailed insights and metrics for @lit/reactive-element
Gathering detailed insights and metrics for @lit/reactive-element
Gathering detailed insights and metrics for @lit/reactive-element
Gathering detailed insights and metrics for @lit/reactive-element
@spectrum-web-components/reactive-controllers
ReactiveControllers for powering common UI patterns
element-vir
Heroic. Reactive. Declarative. Type safe. Web components without compromise.
@3mo/disabled-property
A decorator to add a disabled property to a reactive element.
lit-forms
Lit forms inspired by angular reactive forms
Lit is a simple library for building fast, lightweight web components.
npm install @lit/reactive-element
Typescript
Module System
Node Version
NPM Version
99.7
Supply Chain
100
Quality
85.7
Maintenance
100
Vulnerability
100
License
lit@3.3.0
Updated on Apr 11, 2025
@lit/reactive-element@2.1.0
Updated on Apr 11, 2025
lit-html@3.3.0
Updated on Apr 11, 2025
lit-element@4.2.0
Updated on Apr 11, 2025
@lit/context@1.1.5
Updated on Apr 11, 2025
@lit-labs/nextjs@0.2.3
Updated on Apr 11, 2025
TypeScript (58.93%)
JavaScript (38.48%)
HTML (2.19%)
CSS (0.23%)
Vue (0.17%)
Shell (0.01%)
Total Downloads
205,778,811
Last Day
100,807
Last Week
2,475,428
Last Month
10,916,704
Last Year
104,304,403
BSD-3-Clause License
19,796 Stars
2,567 Commits
969 Forks
210 Watchers
216 Branches
194 Contributors
Updated on Jun 09, 2025
Minified
Minified + Gzipped
Latest Version
2.1.0
Package Id
@lit/reactive-element@2.1.0
Unpacked Size
841.93 kB
Size
171.22 kB
File Count
179
NPM Version
10.8.2
Node Version
20.19.0
Published on
Apr 11, 2025
Cumulative downloads
Total Downloads
Last Day
7.5%
100,807
Compared to previous day
Last Week
-10.2%
2,475,428
Compared to previous week
Last Month
4.1%
10,916,704
Compared to previous month
Last Year
58%
104,304,403
Compared to previous year
1
A simple low level base class for creating fast, lightweight web components.
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:
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.
Full documentation is available at lit.dev.
ReactiveElement
is a base class for writing web components that react to changes in properties and attributes. ReactiveElement
adds reactive properties and a batching, asynchronous update lifecycle to the standard web component APIs. Subclasses can respond to changes and update the DOM to reflect the element state.
ReactiveElement
doesn't include a DOM template system, but can easily be extended to add one by overriding the update()
method to call the template library. LitElement
is such an extension that adds lit-html
templating.
1import { 2 ReactiveElement, 3 html, 4 css, 5 customElement, 6 property, 7 PropertyValues, 8} from '@lit/reactive-element'; 9 10// This decorator defines the element. 11@customElement('my-element') 12export class MyElement extends ReactiveElement { 13 // This decorator creates a property accessor that triggers rendering and 14 // an observed attribute. 15 @property() 16 mood = 'great'; 17 18 static styles = css` 19 span { 20 color: green; 21 } 22 `; 23 24 contentEl?: HTMLSpanElement; 25 26 // One time setup of shadowRoot content. 27 createRenderRoot() { 28 const shadowRoot = super.createRenderRoot(); 29 shadowRoot.innerHTML = `Web Components are <span></span>!`; 30 this.contentEl = shadowRoot.firstElementChild; 31 return shadowRoot; 32 } 33 34 // Use a DOM rendering library of your choice or manually update the DOM. 35 update(changedProperties: PropertyValues) { 36 super.update(changedProperties); 37 this.contentEl.textContent = this.mood; 38 } 39}
1<my-element mood="awesome"></my-element>
Note, this example uses decorators to create properties. Decorators are a proposed standard currently available in TypeScript or Babel. ReactiveElement also supports a vanilla JavaScript method of declaring reactive properties.
1$ npm install @lit/reactive-element
Or use from lit
:
1$ npm install lit
Please see CONTRIBUTING.md.
No vulnerabilities found.
Reason
all last 30 commits are reviewed through GitHub
Reason
30 commit(s) out of 30 and 22 issue activity out of 30 found in the last 90 days -- score normalized to 10
Reason
no vulnerabilities detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
update tool detected
Details
Reason
branch protection is not maximal on development and all release branches
Details
Reason
dependency not pinned by hash detected -- score normalized to 7
Details
Reason
no badge detected
Reason
non read-only tokens detected in GitHub workflows
Details
Reason
dangerous workflow patterns detected
Details
Reason
security policy file not detected
Reason
project is not fuzzed
Score
Last Scanned on 2022-08-15
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More