ErlangFormDocs v1.0.0
Structured data

Record

Render existing dynamic keys and manage keys from your application.

z.record() renders keys already present in the current object using the record value schema. Values remain an object, for example metadata: { source: "website" }.

The Add key and Remove controls in this preview are application code around ErlForm. The library does not provide its own key editor.

Usage

Use your form instance from useForm. See the initial setup.

example.tsx
const schema = z.object({ metadata: z.record(z.string(), z.string()) });

<ErlForm
  form={form}
  schema={schema}
/>

An empty record displays “No record entries yet.” Avoid keys containing dots or square brackets because the internal field path parser uses them as separators. The demo deliberately accepts only simple keys and rejects duplicates.

Update the object with form.setFieldValue to add or remove entries. Record field configuration does not expose typed options for arbitrary dynamic child keys, and the record container component override is not used by the 1.0.0 renderer.

On this page