• A lit-html template that can only be rendered on the server, and cannot be hydrated.

    These templates can be used for rendering full documents, including the doctype, and rendering into elements that Lit normally cannot, like <title>, <textarea>, <template>, and non-executing <script> tags like <script type="text/json">. They are also slightly more efficient than normal Lit templates, because the generated HTML doesn't need to include markers for updating.

    Server-only html templates can be composed, and combined, and they support almost all features that normal Lit templates do, with the exception of features that don't have a pure HTML representation, like event handlers or property bindings.

    Server-only html templates can only be rendered on the server, they will throw an Error if created in the browser. However if you render a normal Lit template inside a server-only template, then it can be hydrated and updated. Likewise, if you place a custom element inside a server-only template, it can be hydrated and update like normal.

    A server-only template can't be rendered inside a normal Lit template.

    Parameters

    • strings: TemplateStringsArray
    • Rest ...values: unknown[]

    Returns LitServerTemplate

Generated using TypeDoc