You're viewing docs for an older version of Lit. Click here for the latest version.

Lit SSR DOM emulation

This package is part of the Lit Labs family of experimental packages. See the Lit Labs page for guidance on using Labs software in production.

When running in Node, Lit automatically imports and uses a set of DOM shims, and defines the customElements global. Only the minimal DOM interfaces needed to define and register components are implemented. These include a few key DOM classes and a roughly functioning CustomElementRegistry.

✅ signifies item is implemented to be functionally the same as in the browser.

PropertyNotes
Element⚠️ Partial
attributes
shadowRoot⚠️ Returns {host: this} if attachShadow() was called with {mode: 'open'}
setAttribute()
removeAttribute()
hasAttribute()
attachShadow()⚠️ Returns {host: this}
getAttribute()
HTMLElement⚠️ Empty class
CustomElementRegistry
define()
get()
customElementsInstance of CustomElementRegistry