Skip to content

Properties

PropertyTypeDescription
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.
minimumAsyncBehaviorTimenumber(optional) Minimum time to display the submit indicator. Default is 1s.
asyncSubmitTimeoutnumber(optional) The maximum time to display the submit indicator before it changes back to normal. In case something went wrong during submission. Default is 30s.
scrollTopOnSubmitboolean(optional) True for the UI to scroll to the top of the page when data is submitted.
sessionStorageIdstring(optional) Key for saving active data to session storage and loading it on mount.
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).
globalStatusIdstring(optional) If needed, you can define a custom GlobalStatus id. Defaults to main.
requiredboolean(optional) Will make all nested form fields required.
disabledboolean(optional) Will disable all nested form 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.
autoCompleteboolean(optional) Will set autoComplete="on" on all nested Field.String-fields.
Spacestring
object
(optional) Spacing properties like top or bottom are supported.
DataContext.ProviderVarious(optional) Provider properties such as data.
Form Attributesstring(optional) All supported form element attributes.