lit /lit
Lit is a simple library for building fast, lightweight web components.
★ 21,897⑂ 1,149👁 211⑃ 2,752● 2,096▤ 574
-2
Daily
+16
Weekly
+46
Monthly
21,897
stars
1,149
forks
211
watchers
2,752
prs
2,096
issues
574
releases
README
Simple. Fast. Web Components.
Lit is a simple library for building fast, lightweight web components.
At Lit's core is a boilerplate-killing component base class that provides reactive state, scoped styles, and a declarative template system that's tiny, fast and expressive.
Documentation
See the full documentation for Lit at lit.dev.
Additional documentation for developers looking to contribute or understand more about the project can be found in dev-docs.
npm
To install from npm:
sh
npm i lit
Lit Monorepo
This is the monorepo for Lit packages.
lit 2.x source is available on the 2.x branch.
lit-html 1.x source is available on the lit-html-1.x branch.
Packages
- Core packages
- lit - The primary user-facing package of Lit which includes everything from lit-html and lit-element.
- lit-element - The web component base class used in Lit.
- lit-html - The rendering library used by LitElement.
- @lit/reactive-element - A low level base class that provides a reactive lifecycle based on attribute/property changes.
- Additional libraries
- @lit/localize - A library and command-line tool for localizing web applications built using Lit.
- @lit/localize-tools - Localization tooling for use with @lit/localize.
- @lit/react - A React component wrapper for web components.
- @lit/task - A controller for Lit that renders asynchronous tasks.
- @lit/context - A system for passing data through a tree of elements using browser events, avoiding the need to pass properties down every layer of the tree using a community defined protocol.
- Labs
- @lit-labs/ssr - A server package for rendering Lit templates and components on the server.
- @lit-labs/ssr-client - A set of client-side support modules for rendering Lit components and templates on the server using @lit-labs/ssr.
- @lit-labs/eleventy-plugin-lit - A plugin for Eleventy that pre-renders
Lit components using @lit-labs/ssr with optional hydration.
- @lit-labs/ssr-react - A package for integrating Lit SSR with React and React frameworks.
- @lit-labs/nextjs - A plugin for Next.js that enables deep server rendering of Lit components with Lit SSR.
- @lit-labs/router - A router for Lit.
- @lit-labs/motion - Lit directives for making things move
- @lit-labs/scoped-registry-mixin - A mixin for LitElement that integrates with the speculative Scoped CustomElementRegistry polyfill.
- @lit-labs/observers - A set of reactive controllers that facilitate using the platform observer objects.
- @lit-labs/preact-signals - Preact Signals integration for Lit.
- @lit-labs/signals - TC39 proposal Signals integration for Lit.
- @lit-labs/testing - Utilities for testing Lit components.
- @lit-labs/virtualizer - Viewport-based virtualization (including virtual scrolling).
- @lit-labs/compiler - A compiler for optimizing Lit templates.
- Starter kits (not published to npm)
- lit-starter-ts (template
repo) - A starter repo for building reusable components usingTop issues
#923[lit-html] Add syntax for spreading attributes, properties, and event listeners66 comments · 2019-05-21#4527[labs/ssr] Investigate interactions with minified or unminified lit-html39 comments · 2024-01-29#4455[reactive-element] Provide assistance for dealing with conflicting element definitions26 comments · 2023-12-14#4023[labs/react]Using @lit-labs/react to wrap components in an SSR environment(Remix) will result in attributes not being immediately passed to the component20 comments · 2023-07-17#4788[lit-html] Do not stringify boolean values in child parts18 comments · 2024-10-06#2469[labs/ssr] do we need special ssr only async decorators?18 comments · 2022-01-29#1891[localize] ICU select / plural / genders functions18 comments · 2021-05-12#1661[localize] Improved support for component libraries18 comments · 2021-03-08
Discussions
#5430Open-source Playwright browser QA (8 traps), UI contrast/craft auditor & 92-rule security scanner (CLI + MCP)0 comments · 2026-11-15#5408Unframed: accessible UI components built with Lit, for any framework0 comments · 2026-10-17#5307Maturity of signals api? How to choose between signals and context?1 comments · 2026-04-18#5222How to fetch data, and use that *after* render2 comments · 2026-02-12#5200How to migrate Polymers getSanitizeDOMValue to lit0 comments · 2026-01-02#5187How do I provide the template data to the client when Server-Side Rendering?0 comments · 2025-12-21#5166Labs Feedback: @lit-labs/forms0 comments · 2025-12-02#5160variable Environment for endpoint [GET, POST]0 comments · 2025-11-17
Latest release
@lit-labs/[email protected] @lit-labs/[email protected] 2026-05-14Minor Changes - 4893 6c051d517bd92761787897b2c8c060ed419126e2 Thanks @kyubisation! - Implement ShadowRoot and document in event path - 4894 baa780d2b78a4b792cf61b220b8e3e186739d48c Thanks @kyubisation! - Add DOM shim implementation for MutationObserver, ResizeObserver and IntersectionObserver Patch Changes - 5240 b9de4295489b0caf91069bfe21f640f3ab5e12bb Thanks @kyubisation! - Register CSSStyleSheet polyfill in global scope when using Node.js hook for importing CSS files - 5330 077a4b727d0d30540f1813bbbe66477790c9805e Thanks @cecilyhunt! - fix(ssr-dom-shim): Add stubs for TS 6.0.3