Skip to content

Properties

Field-specific properties

PropertyTypeDescription
multilineboolean(optional) True to be able to write in multiple lines (switching from input-element to textarea-element).
leftIconstring(optional) For icon at the left side of the text input. Only one of leftIcon or rightIcon can be used at the same time.
rightIconstring(optional) For icon at the right side of the text input. Only one of leftIcon or rightIcon can be used at the same time.
capitalizeboolean(optional) When set to true, it will capitalize the first letter of every word, transforming the rest to lowercase.
trimboolean(optional) When true, it will trim leading and trailing whitespaces on blur, triggering onChange if the value changes.
inputModestring(optional) Define an inputmode.
autoCompleteon
string
(optional) For HTML autocomplete attributes.
minLengthnumber(optional) Validation for minimum length of the text (number of characters).
maxLengthnumber(optional) Validation for maximum length of the text (number of characters).
patternstring(optional) Validation based on regex pattern.
widthstring
false
(optional) false for no width (use browser default), small, medium or large for predefined standard widths, stretch to fill available width.
sizestring
number
(optional) The sizes you can choose is default (2rem), medium (2.5rem) and large (3rem) are supported component sizes. Defaults to default / null. Also, if you define a number like size={2} then it will be forwarded as the input element attribute. Consider rather setting field sizes with Form.Appearance.
alignstring(optional) Defines the text alignment of the input. Can be left, right or center. Defaults to left.
selectallboolean(optional) If set to true, then the whole input value gets selected on the entry focus. A second click will place the cursor on the wanted position.
clearboolean(optional) If set to true, then a clear button will be shown which lets the user clear any given input value.
keepPlaceholderboolean(optional) Set to true in case the placeholder has to be kept during focus. By default, the placeholder disappears on focus.
rowsnumber(optional) To be used together with multiline. Set how many rows of text can be shown by default. Defaults to 2.
autoresizeMaxRowsnumber(optional) To be used together with multiline. Set how many rows of text can be shown at max. Defaults to 6.
characterCounternumber
object
(optional) To be used together with multiline. Use a number to define the displayed max length e.g. 40 or { max: 40, variant: 'down' }.
autoresizeboolean(optional) To be used together with multiline. Set true to expand when writing longer texts. Defaults to true.
inputClassNamestring(optional) Class name set on the <input> DOM element.
innerRefReact.RefObject(optional) By providing a React.Ref we can get the internally used input element (DOM).
submitElementReact.Element(optional) Accepts a React element which will show up like the "submit button" would do on type="search".

General properties

PropertyTypeDescription
valuestring(optional) Source data value for the field. Will take precedence over the path value given in the data context.
defaultValuestring(optional) Default source data value for the field. Will not take precedence over the path value given in the data context.
pathstring(optional) JSON Pointer for where the data for the field is located in the source dataset (when using Form.Handler or DataContext). The path will also be set as the name attribute for the string-field.
infoReact.Node
Array<React.Node>
function
(optional) Info message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with { conditionally, getValueByPath, getFieldByPath }. To show the message first after the user has interacted with the field, you can call and return conditionally function with a callback and with options: conditionally(() => 'Your message', { showInitially: true })
warningReact.Node
Array<React.Node>
function
(optional) Warning message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with { conditionally, getValueByPath, getFieldByPath }. To show the message first after the user has interacted with the field, you can call and return conditionally function with a callback and with options: conditionally(() => 'Your message', { showInitially: true })
errorError
FormError
Array<Error | FormError>
function
(optional) Error message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with { conditionally, getValueByPath, getFieldByPath }. To show the message first after the user has interacted with the field, you can call and return conditionally function with a callback and with options: conditionally(() => 'Your message', { showInitially: true })
disabledboolean(optional) Set true to show the field but without the possibility of changing the value.
emptyValuestring
undefined
(optional) The value to use (in onChange events etc) when emptying the field. Makes it possible for instance to provide undefined instead of an empty string when clearing the content of a text input.
requiredboolean(optional) When set to true, the field will give an error if the value fails the required validation. When set to false, the field will not be required, but will add a "(optional)" suffix to the label.
labelSuffixReact.Node(optional) Will append an additional text to the label, like "(optional)". When using inheritLabel, the suffix will not be inherited. NB: The visual appearance of the labelSuffix may change in the future.
schemaobject(optional) Custom JSON Schema for validating the value.
validateInitiallyboolean(optional) Set to true to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.
validateUnchangedboolean(optional) Set to true to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.
validateContinuouslyboolean(optional) Set to true to show validation based errors continuously while writing, not just when blurring the field.
errorMessagesobject(optional) Custom error messages for each type of error, overriding default messages. The messages can be a React.ReactNode or a string.
onChangeValidatorfunction(optional) Custom validator function where you can return undefined, Error, FormError or an Array with either several other validators or several Error or FormError. It is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.
onBlurValidatorfunction(optional) Custom validator function where you can return undefined, Error, FormError or an Array with either several other validators or several Error or FormError. It is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.
transformInfunction(optional) Transforms the value before its displayed in the field (e.g. input).
transformOutfunction(optional) Transforms the value before it gets forwarded to the form data object (context) or returned as the onChange value parameter. The first parameter is the internal value. Some fields do support a second parameter, like the SelectCountry, where the country object is given.
labelstring(optional) Field label to show above / before the input feature.
labelDescriptionstring(optional) A more discreet text displayed beside the label (i.e for "(optional)").
labelDescriptionInlineboolean(optional) If true, the labelDescription will be displayed on the same line as the label.
labelSrOnlyboolean(optional) Use true to make the label only readable by screen readers.
labelSizemedium
large
(optional) Define the font-size of the label based on the font-size table.
helpobject(optional) Provide help content for the field using title and content as a string or React.Node. Additionally, you can set open to true to display the inline help, set the breakout property to false to disable the breakout of the inline help content, or use renderAs set to dialog to render the content in a Dialog (recommended for larger amounts of content).
layoutstring(optional) Layout for the label and input. Can be horizontal or vertical.
layoutOptionsobject(optional) Use this to set additional options for the horizontal layout. E.g. { width: "medium" }. You can also use a custom width {number}rem. Instead of a width, you can use a min/max width. E.g. { minWidth: "6rem", maxWidth: "12rem" }.
widthstring
false
(optional) Will set the width for the whole block. Use small, medium, large for predefined standard widths. You can also set a custom width {number}rem or use stretch or false.
contentWidthstring
false
(optional) Will set the width for its contents. Use small, medium, large for predefined standard widths. You can also set a custom width {number}rem or use stretch or false.
Spacestring
object
(optional) Spacing properties like top or bottom are supported.

Translations

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

Keynb-NOen-GBsv-SEda-DK
Email.labelE-postadresseEmail addressE-postadressE-mailadresse
Email.errorRequiredDu må fylle inn en e-postadresse.You must enter a Email address.Du måste fylla i en e-postadress.Du skal udfylde en e-mailadresse.
Email.errorPatternUgyldig e-postadresse. Skriv inn en e-postadresse.Invalid Email address. Enter a valid Email address.Ogiltig e-postadress. Ange en e-postadress.Ugyldig e-mailadresse. Indtast en e-mailadresse.
Field.errorSummaryTitleFeil som må rettesPlease correct the following errorsFel som måste åtgärdasFelter der skal rettes
Field.stateSummaryOppsummering:Summary:Sammanfattning:Oversigt:
Field.errorSummaryFeil som må rettes:Please correct the following errors:Fel som måste åtgärdas:Felter der skal rettes:
Field.errorRequiredDette feltet må fylles ut.This field is required.Detta fält måste fyllas i.Dette felt skal udfyldes.
Field.errorPatternVerdien er ugyldig.The value is invalid.Värdet är ogiltigt.Ugyldig værdi.
Field.optionalLabelSuffix(valgfritt)(optional)(valfritt)(valgfrit)