Buckets:
| Name | Size | Uploaded | Xet hash |
|---|---|---|---|
| decorators | 36 items | ||
| development | 56 items | ||
| LICENSE | 1.52 kB xet | db19e73e | |
| README.md | 2.13 kB xet | c5678e63 | |
| decorators.d.ts | 724 Bytes xet | 8f0e7d10 | |
| decorators.d.ts.map | 332 Bytes xet | 247cfcfa | |
| decorators.js | 598 Bytes xet | 56559a6b | |
| decorators.js.map | 94 Bytes xet | 5722e5cb | |
| index.d.ts | 224 Bytes xet | 19a43a6b | |
| index.d.ts.map | 182 Bytes xet | 8a5d9eae | |
| index.js | 138 Bytes xet | bd99fcf8 | |
| index.js.map | 89 Bytes xet | a9386d09 | |
| lit-element.d.ts | 6.18 kB xet | 41e7edc1 | |
| lit-element.d.ts.map | 1.05 kB xet | 11d065bd | |
| lit-element.js | 1.12 kB xet | bcdea7ee | |
| lit-element.js.map | 11.4 kB xet | 87f6de1a | |
| package.json | 7.89 kB xet | 98e137c0 | |
| polyfill-support.d.ts | 1.13 kB xet | f6b04eda | |
| polyfill-support.d.ts.map | 209 Bytes xet | 46fa1b75 | |
| polyfill-support.js | 3.8 kB xet | ce6223b2 | |
| polyfill-support.js.map | 25 kB xet | ce45c8c5 | |
| private-ssr-support.d.ts | 883 Bytes xet | a54c05ff | |
| private-ssr-support.d.ts.map | 197 Bytes xet | 5d54983d | |
| private-ssr-support.js | 259 Bytes xet | 48507d30 | |
| private-ssr-support.js.map | 1.09 kB xet | bb158f9f |
LitElement
A simple base class for creating fast, lightweight web components.
LitElement is the base class that powers the Lit library for building fast web components.
Most users should import LitElement from the lit package rather than installing and importing from the lit-element package directly.
Documentation
Full documentation is available at lit.dev/docs/components/overview/.
Overview
LitElement is a base class for custom elements that extends the Lit project's core ReactiveElement (from [`@lit/reactive-element'](https://www.npmjs.com/package/@lit/reactive-element)) base class with lit-html templating. ReactiveElement enhances HTMLElement with reactive properties, additional lifecycle callbacks, convenient inline CSS authoring, and a set of useful class decorators, while lit-html provides fast, declarative HTML templating.
Example
import {LitElement, html, css} from 'lit';
import {customElement, property} from 'lit/decorators.js';
// Registers the element
@customElement('my-element')
export class MyElement extends LitElement {
// Styles are applied to the shadow root and scoped to this element
static styles = css`
span {
color: green;
}
`;
// Creates a reactive property that triggers rendering
@property()
mood = 'great';
// Render the component's DOM by returning a Lit template
render() {
return html`Web Components are <span>${this.mood}</span>!`;
}
}
Contributing
Please see CONTRIBUTING.md.
- Total size
- 149 MB
- Files
- 6,599
- Last updated
- Jun 23
- Pre-warmed CDN
- US EU US EU