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

    Interface LitRenderProps

    Props handed to a Lit render function.

    Shares the same per-field data as RenderProps (React) and HtmlRenderProps (HTML-string) but with a renderChild typed over Lit's TemplateResult. Editable fields receive a change callback that emits a Custom Event up the DOM tree — unlike React's prop-callback model, Custom Elements communicate via DOM events, so the renderer wires the input event to a dispatchEvent(new CustomEvent("sc-change", { detail: { value } })) on the host element.

    Renderers narrow on tree.type for per-variant data (object fields, array element schema, union options, etc.) — the walker's discriminated union enforces type-correct access.

    interface LitRenderProps {
        value: unknown;
        readOnly: boolean;
        writeOnly: boolean;
        meta: SchemaMeta;
        constraints: AllConstraints;
        path: string;
        examples?: unknown[];
        tree: WalkedField;
        change: (value: unknown) => void;
        renderChild: (
            tree: WalkedField,
            value: unknown,
            change: (next: unknown) => void,
            pathSuffix?: string,
        ) => TemplateResult;
    }
    Index

    Properties

    value: unknown

    Current field value.

    readOnly: boolean

    Whether to render as read-only display.

    writeOnly: boolean

    Whether to render as an empty input.

    Schema metadata for this field.

    constraints: AllConstraints

    Constraints from schema checks.

    path: string

    Dot-separated path from root (e.g. "address.city").

    examples?: unknown[]

    Example values from the schema's examples keyword.

    Walked field tree for recursive rendering.

    change: (value: unknown) => void

    Callback to propagate the next value back to the host element.

    Renderers wire DOM events (@input, @change, @click on add / remove controls) to this callback. The host element catches the resulting change and emits a change Custom Event on itself so framework consumers can observe via standard addEventListener.

    renderChild: (
        tree: WalkedField,
        value: unknown,
        change: (next: unknown) => void,
        pathSuffix?: string,
    ) => TemplateResult

    Render a child field. Resolver overrides call this to recursively render nested structures (object fields, array elements, union options) without re-running the resolver dispatch loop.

    Type Declaration

      • (
            tree: WalkedField,
            value: unknown,
            change: (next: unknown) => void,
            pathSuffix?: string,
        ): TemplateResult
      • Parameters

        • tree: WalkedField

          The walked field tree for the child

        • value: unknown

          The child's current value

        • change: (next: unknown) => void

          Callback receiving the child's next value

        • OptionalpathSuffix: string

          Path segment from the parent (e.g. city for an object key, [0] for an array index). Required for every container — without it children inherit no path and DOM id derivation throws.

        Returns TemplateResult