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

    Function registerLitWidget

    • Register a widget globally. The widget is resolved when a schema field has .meta({ component: name }) and the rendered element is an instance of the matching Custom Element tag.

      tag must be a valid Custom Element name (containing a hyphen) and SHOULD be registered via customElements.define before any <schema-component> in the document instantiates the corresponding field — otherwise the browser emits an unupgraded element and the registered handler never runs.

      Parameters

      • name: string

        Widget hint name (matches .meta({ component })).

      • tag: string

        Custom Element tag name (e.g. my-color-picker).

      Returns void

      import { registerLitWidget } from "schema-components/lit/widget";
      import "./my-color-picker.ts"; // calls customElements.define("my-color-picker", ...)

      registerLitWidget("color-picker", "my-color-picker");