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

    Interface SchemaFieldProps<T, SchemaRef, P>

    Props accepted by SchemaField. The generic P constrains path to dot-paths reachable through the schema's inferred value type — typed schemas get autocomplete; runtime schemas fall back to string.

    interface SchemaFieldProps<
        T = unknown,
        SchemaRef extends string | undefined = undefined,
        P extends
            string =
            | PathOfType<InferSchemaType<T>>
            | (string extends PathOfType<InferSchemaType<T>> ? string : never),
    > {
        path: P;
        schema: RejectUnrepresentableZod<T>;
        schemaRef?: SchemaRef;
        value?: unknown;
        onChange?: (value: unknown) => void;
        meta?: SchemaMeta;
        validate?: boolean;
        onValidationError?: (error: unknown) => void;
    }

    Type Parameters

    Index

    Properties

    path: P

    Dot-separated path to the field (e.g. "address.city"). When the schema is a Zod schema or typed as const, only valid paths are accepted. Falls back to string for runtime schemas.

    The schema to extract the field from. Subject to the same unrepresentable-Zod rejection as SchemaComponentProps.schema.

    schemaRef?: SchemaRef

    For OpenAPI / JSON Schema documents: a $ref string. Named schemaRef (not ref) to avoid the React / preact/compat reserved prop name. See SchemaComponentProps.schemaRef.

    value?: unknown

    Current value of the field at the given path.

    onChange?: (value: unknown) => void

    Called with the updated root value when this field changes.

    meta?: SchemaMeta

    Override meta for this specific field.

    validate?: boolean

    Run validation on change.

    onValidationError?: (error: unknown) => void