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

    Function renderToHtml

    • Render a schema to a semantic HTML string.

      Framework-agnostic alternative to the React rendering pipeline. Shares the same normalise → walk → render pipeline, but emits escaped HTML with sc- prefixed classes rather than ReactNodes. Pass resolver to plug in a custom HTML renderer.

      Type Parameters

      • T = unknown
      • Ref extends string | undefined = undefined
      • Mode extends SchemaIoSide = "output"

      Parameters

      Returns string

      Semantic HTML string with sc- prefixed classes

      import { renderToHtml } from "schema-components/html/renderToHtml";

      const html = renderToHtml(userSchema, { value: user, readOnly: true });