Skip to content

Properties

Field-specific properties

PropertyTypeDescription
rangeboolean(optional) Defines if the Date field should support a value of two dates (starting and ending date). The value needs to be a string containing two dates, separated by a pipe character (|) (01-09-2024|30-09-2024) when this is set to true. Defaults to false.
showInputboolean(optional) If the input fields with the mask should be visible. Defaults to true.
showCancelButtonboolean(optional) If set to true, a cancel button will be shown. You can change the default text by using cancelButtonText="Avbryt" Defaults to true. If the range property is true, then the cancel button is shown.
showResetButtonboolean(optional) If set to true, a reset button will be shown. You can change the default text by using resetButtonText="Tilbakestill" Defaults to true.
sizestring(optional) The sizes you can choose is small (1.5rem), default (2rem), medium (2.5rem) and large (3rem) are supported component sizes. Defaults to default / null. Consider rather setting field sizes with Form.Appearance.
monthstring
Date
(optional) To display what month should be shown in the first calendar by default. Defaults to the date respective startDate.
startMonthstring
Date
(optional) To display what month should be shown in the first calendar by default. Defaults to the date respective startDate.
endMonthstring
Date
(optional) To display what month should be shown in the second calendar by default. Defaults to the date respective startDate.
minDatestring
Date
(optional) To limit a date range to a minimum startDate. Defaults to null.
maxDatestring
Date
(optional) To limit a date range to a maximum endDate. Defaults to null.
dateFormatstring(optional) Defines how the property dates (date, startDate and endDate) should be parsed, e.g. yyyy/MM/dd. Defaults to yyyy-MM-dd.
returnFormatstring(optional) Defines how the returned date, as a string, should be formatted as. Defaults to yyyy-MM-dd.
maskOrderstring(optional) To define the order of the masked placeholder input fields. Defaults to dd/mm/yyyy.
openedboolean(optional) To open the date-picker by default. Defaults to false.
maskPlaceholderstring(optional) To display the placeholder on input. Defaults to dd/mm/åååå.
hideNavigationboolean(optional) If set to true, the navigation will be hidden. Defaults to false.
hideDaysboolean(optional) If set to true, the week days will be hidden. Defaults to false.
showSubmitButtonboolean(optional) If set to true, a submit button will be shown. You can change the default text by using submitButtonText="Ok". Defaults to false. If the range property is true, then the submit button is shown.
linkboolean(optional) Link both calendars, once to the user is navigating between months. Only meant to use if the range is set to true. Defaults to false.
syncboolean(optional) Sync input values with the calendars views. Once the input values get changed, the calendar changes its views in sync. Defaults to true.
firstDaymonday
tuesday
wednesday
thursday
friday
saturday
sunday
(optional) To define the first day of the week. Defaults to monday.
alignPickerstring(optional) Use right to change the calendar alignment direction. Defaults to left.
skipPortalboolean(optional) If set to true, the calendar will not be rendered inside a react portal. Defaults to false.
yearNavigationboolean(optional) Will enable year navigation in the calendar if set to true. Defaults to false.
onlyMonthboolean(optional) Use true to only show the defined month. Disables the month navigation possibility. Defaults to false.
hideLastWeekboolean(optional) Use true to only show the last week in the current month if it needs to be shown. The result is that there will mainly be shows five (5) weeks (rows) instead of six (6). Defaults to false.
shortcutsobject(optional) Gives you the possibility to set predefined dates and date ranges so the user can select these by one click. Define either a JSON or an object with the defined shortcuts. More info is below.
addonElementobject(optional) Gives you the possibility to inject a React element showing up over the footer. Use it to customize shortcuts.
disableAutofocusboolean(optional) Once the date picker gets opened, there is a focus handling to ensure good accessibility. This can be disabled with this property. Defaults to false.
onBlurValidatorfunction(optional) Custom validator function that 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 }. Defaults to validating invalid dates, and dates against minDate and maxDate, using dateValidator. Can be disabled using false.

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 }.
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
Date.labelDatoDateDatumDato
Date.errorRequiredDu må fylle inn en dato.You must enter a date.Du måste fylla i en datum.Du skal udfylde en dato.
Date.errorRequiredRangeDu må fylle inn en datoperiode.You must enter a date range.Du måste fylla i en datumintervall.Du skal udfylde et datointerval.
Date.errorMinDateValgt dato kan ikke være før {date}.Chosen date cannot be before {date}.Valt datum kan inte vara före {date}.Valgt dato må ikke være før {date}.
Date.errorMaxDateValgt dato kan ikke være etter {date}.Chosen date cannot be after {date}.Valt datum kan inte vara efter {date}.Valgt dato må ikke være efter {date}.
Date.errorStartDateMinDateStartdato kan ikke være før {date}.Start date cannot be before {date}.Startdatum kan inte vara före {date}.Startdato må ikke være før {date}.
Date.errorStartDateMaxDateStartdato kan ikke være etter {date}.Start date cannot be after {date}.Startdatum kan inte vara efter {date}.Startdato må ikke være efter {date}.
Date.errorEndDateMinDateSluttdato kan ikke være før {date}.End date cannot be before {date}.Slutdatum kan inte vara före {date}.Slutdato må ikke være før {date}.
Date.errorEndDateMaxDateSluttdato kan ikke være etter {date}.End date cannot be after {date}.Slutdatum kan inte vara efter {date}.Slutdato må ikke være efter {date}.
Date.errorInvalidDateUgyldig dato.Invalid date.Ogiltigt datum.Ugyldig dato.
Date.errorInvalidStartDateUgyldig startdato.Invalid start date.Ogiltigt startdatum.Ugyldig startdato.
Date.errorInvalidEndDateUgyldig sluttdato.Invalid end date.Ogiltigt slutdatum.Ugyldig slutdato.
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)