interface

FieldBinding

Read and update one field in the unsaved form, including validation messages and live feedback.

Properties and methods

PropertyTypeDescription
schemaSchemaField & { type: Type; }A copy of the resolved field definition, including its current path, label and rules. schema.admin.readOnly reflects field configuration and access, not a pending document save.
valueFieldEditorValue<Type> | null | undefinedCurrent form value, including unsaved edits; null/undefined mean empty or absent.
issuesreadonly ValidationIssue[]Current validation issues, including errors returned by a document save.
liveValidationFieldLiveValidationRead the check’s status or call retry() after a failure. Ridu runs the requests; messages appear alongside other validation issues in field.issues.
readOnlybooleanWhether changes are blocked right now, including during a document save. set checks this again when called.
stalebooleanTrue once the connection expires. Value becomes undefined, issues empty and writes throw.
inputProps{ id: string; name: string; required: boolean; "aria-invalid": boolean; "aria-describedby": string | undefined; "aria-errormessage": string | undefined; }ID, name and accessibility attributes for your input. Spread these onto the control, and handle field.readOnly and value changes separately. The optional Field wrapper supplies the matching label and error messages. Native required is false for boolean and list controls: a list requires entries, not nonempty text in every item. Ridu validates the container on save.
set(value: FieldEditorValue<Type> | null) => voidChange the value in the unsaved form; null clears it. This does not save to the server. Throws if stale, read-only, or given the wrong value type. Lists are copied on reads and writes. Normal field validation and server authorization still apply on document save.

How it works

Ridu creates and cleans up this field connection. For arrays and blocks, it follows the row’s stable _key through reorder. Removing the field or replacing the form makes the connection stale; use the binding supplied to the newly mounted editor.

Full signature

Methods

  • FieldBinding.set()

    Change the value in the unsaved form; null clears it. This does not save to the server. Throws if stale, read-only, or given the wrong value type. Lists are copied on reads and writes. Normal field validation and server authorization still apply on document save.

Related guides