LitElement is a base class for creating fast, lightweight web components with declarative rendering.
LitElement solves the problem of building reusable web components by providing a simple foundation that combines lit-html templating with reactive property management. It renders templates into the element's Shadow DOM and automatically re-renders when properties change, allowing developers to write components declaratively. The library handles the connection between property changes and DOM updates, reducing boilerplate code typically required for web component development.
Developers should be aware that this repository maintains the legacy LitElement 2.x codebase. The project has moved into the Lit monorepo, where LitElement 3.x is now developed as part of the broader Lit library alongside lit-html 2.x. New projects should consider using Lit 2 instead. LitElement suits teams building custom elements that need to work across modern browsers and Internet Explorer 11 with polyfills. The library supports both TypeScript decorators and vanilla JavaScript for declaring reactive properties, making it accessible regardless of build tooling preferences.
Development on this repository is focused on maintenance of the legacy version. The project provides forward compatibility guidance to help users migrate to Lit 2, including deprecated APIs that have been back-ported to ease the upgrade path.