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

    Interface SvelteRenderProps

    Props passed to every Svelte 5 renderer component.

    Specialisation of BaseRenderProps with Output = SvelteRenderDescriptor | null. Each renderer receives these as $props() — the per-field data, the editability flags, the constraint bundle, and the renderChild factory it should invoke for nested structures (object fields, array elements, union options, …).

    Mirrors the React "../core/renderer.ts".RenderProps shape — onChange for value propagation, four-argument renderChild for recursive descent.

    interface SvelteRenderProps {
        value: unknown;
        readOnly: boolean;
        writeOnly: boolean;
        meta: SchemaMeta;
        constraints: AllConstraints;
        path: string;
        examples?: unknown[];
        tree: WalkedField;
        onChange: (value: unknown) => void;
        renderChild: (
            tree: WalkedField,
            value: unknown,
            onChange: (v: unknown) => void,
            pathSuffix?: string,
        ) => SvelteRenderDescriptor | null;
    }

    Hierarchy (View Summary)

    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.

    onChange: (value: unknown) => void

    Callback to update the field value.

    renderChild: (
        tree: WalkedField,
        value: unknown,
        onChange: (v: unknown) => void,
        pathSuffix?: string,
    ) => SvelteRenderDescriptor | null

    Render a child field. Container renderers (object, array, tuple, record, union, discriminated union, conditional, negation) call this and mount the returned descriptor via <svelte:component this={component} {...props} />.

    Type Declaration

      • (
            tree: WalkedField,
            value: unknown,
            onChange: (v: unknown) => void,
            pathSuffix?: string,
        ): SvelteRenderDescriptor | null
      • Parameters

        • tree: WalkedField

          The walked field tree for the child.

        • value: unknown

          The child's current value.

        • onChange: (v: unknown) => void

          Callback receiving the child's next value.

        • OptionalpathSuffix: string

          Path segment from the parent (e.g. "city", "[0]"). Joined to the parent's path with a dot, or substituted when the parent acts as a transparent wrapper (union options). Required for every container — without it children inherit no path and fieldDomId() will throw.

        Returns SvelteRenderDescriptor | null