schema-components - v3.7.0
    Preparing search index...

    Function renderShadowedHtml

    • Render a Lit TemplateResult to an HTML string, emitting Declarative Shadow DOM markup for every Custom Element it contains.

      The synchronous variant (collectResultSync) is documented to throw when the underlying render emits async iterables — which happens whenever a component uses until, asyncReplace, or similar async directives. The built-in <sc-*> elements never do this, so the synchronous path is safe for the default use. Consumer widgets that introduce async behaviour must use the streaming SSR API directly (out of scope for this entry).

      Parameters

      • template: TemplateResult

        The Lit template to render.

      Returns string

      The rendered HTML string with Declarative Shadow DOM markup.

      import { html } from "lit";
      import "schema-components/lit/registry"; // registers <sc-*>
      import { renderShadowedHtml } from "schema-components/lit/ssr";

      const tpl = html`<schema-view .schema=${userSchema} .value=${user}></schema-view>`;
      const markup = renderShadowedHtml(tpl);