Skip to content

Properties

PropertyTypeDescription
pathstring(optional) JSON Pointer to define the object key for all the generated nested field data. When provided, Form.Isolation will inherit schema validation from the parent Form.Handler for fields within this path.
transformOnCommitfunction(optional) Transform the data before it gets committed to the form. The first parameter is the isolated data object. The second parameter is the outer context data object (Form.Handler).
commitHandleRefReact.RefObject(optional) Provide a ref to a function that can be called from any location to commit the data to the form.
bubbleValidationboolean(optional) Prevent the form from being submitted when there are fields with errors inside the Form.Isolation.
preventUncommittedChangesboolean(optional) Prevents uncommitted changes before the form is submitted. Will display an error message if user tries to submit without committing their changes.
resetDataAfterCommitboolean(optional) If set to true, the Form.Isolation will reset its data context after committing the data to the outer context.
dataReferenceIsolationDataReference(optional) Provide a reference by using Form.Isolation.createDataReference.
defaultDataobject(optional) Default source data, only used if no other source is available, and not leading to updates if changed after mount.
dataobject(optional) Dynamic source data used as both initial data, and updates internal data if changed after mount.
idstring
Function
Object
React.Context
(optional) Unique id for connecting Form.Handler and helper tools such as Form.useData.
schemaobject(optional) JSON Schema for validation of the data set. IMPORTANT: When using JSON Schema validation, you MUST provide an ajvInstance prop.
errorMessagesobject(optional) Object containing error messages by either type of JSON Pointer path and type. The messages can be a React.ReactNode or a string.
ajvInstanceajv(optional) REQUIRED when using JSON Schema validation. Provide your own custom Ajv instance: import Ajv from "@dnb/eufemia/extensions/forms" and pass ajvInstance={makeAjvInstance()}. This ensures your bundle only includes AJV when you actually need it. More info in the Schema validation section.
transformInfunction(optional) Mutate the data context (internally as well) based on your criteria: ({ path, value, data, props, internal }) => 'new value'. It will iterate on each data entry (/path).
transformOutfunction(optional) Mutate the data before it enters onSubmit or onChange based on your criteria: ({ path, value, data, props, internal }) => 'new value'. It will iterate on each data entry (/path).
requiredboolean(optional) Make all fields required.
disabledboolean(optional) Disable all fields.
localestring(optional) Locale (language) to use for all nested Eufemia components.
countryCodeISO 3166-1 alpha-2
Path/JSON Pointer
(optional) Will change the country code for fields supporting countryCode. You can also set a path as the value, e.g. /myCountryCodePath.
childrenReact.Node(required) Contents.

Translations

More info about translations can be found in the general localization and Eufemia Forms localization docs.

Keynb-NOen-GBsv-SEda-DK
Isolation.commitButtonTextLegg tilAddLägg tillTilføj
Isolation.preventUncommittedChangesTextDu har endringer som enten må legges til eller nullstilles.You have changes that either need to be added or cleared.Du har ändringar som antingen måste läggas till eller rensas.Du har ændringer, som enten skal tilføjes eller nulstilles.