Input Component

1. Overview

The INPUT component provides a versatile text input field supporting various input types (text, email, number, password, etc.) with optional masking and formatting capabilities.

🛝 Use the Dynamic Form Playground to see the Input component in action and try out different configurations

2. Key Features

  • Multiple input types: text, email, number, password, tel, url, search, color
  • Input masking support (including IBAN)
  • Uppercase formatting option
  • Input prefix and suffix support
  • Character limit control
  • Translation and string interpolation support

3. Configuration Properties

Base Properties

PropertyTypeRequiredDescription
type'INPUT'YesSpecifies the field type as INPUT.
idstringYesUnique identifier for the field. The field's value is stored in the form state under this key.
renderNamestringNoOptional name added as data-render-name attribute to locate the rendered element in the DOM.
labelstringYesLabel text displayed above the field. Supports translation and string interpolation.
valuestring or numberNoThe field's initial value. Use string for all input types except number. Use number when inputType is "number".
hintstringNoAdditional hint text displayed below the field.
notestringNoInformational note displayed when there are no errors.
infoIconDfInfoIconConfigNoInfo icon with popover. Object with popoverText (string, required) and popoverDirection ('top', 'bottom', 'left', 'right').
validatorsarrayNoValidation rules for the field. Common types: REQUIRED, EMAIL, MIN, MAX, MIN_LENGTH, MAX_LENGTH, PATTERN. Each validator has type and optional errorMessage.
testIdstringNoTest identifier for automated testing. Set as data-testid attribute.
aclarrayNoAccess control rules for field visibility/editability. Each rule has state ('hidden', 'readonly', 'disabled', 'visible', 'editable') and optional condition (Filtrex expression).
columnSpannumberNoNumber of columns to span (1-12) in CUSTOM_COLUMN layout. Default: 12 (full width). See Overriding the number of grid columns when using --df-custom-columns.
spacingstringNoMargin spacing before next field: 'NONE' (0px), 'XS' (8px), 'S' (16px), 'M' (24px), 'L' (32px), 'XL' (40px), 'XXL' (48px).

Component Specific Properties

PropertyTypeRequiredDescription
inputTypestringYesThe type of input element to use.
Only types supported by NDBX's Input component are permitted.
Explanations for the different kinds of input can be found here:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
Careful! When an nxMask is used, only "password", "search", "tel", "text", "url" are supported.
formatUpperCasebooleanNoBoolean to determine if input value needs to be formatted to uppercase
inputPrefixstringNoPrefix text to place at the start of this field's input.
It's translatable by default and supports string interpolation.
inputSuffixstringNoSuffix text to place at the end of this field's input.
It's translatable by default and supports string interpolation.
layoutobjectNoThe layout of the field.
See also Layout Properties
maxLengthnumberNoThe maximum number of characters allowed for user input.
nxMaskNxMaskWithMaskConfig | NxMaskIbanOnlyConfigNoConfiguration of an ndbx input mask.
See the ndbx documentation on how to use the inputs:
https://ngx-brand-kit.frameworks.allianz.io/documentation/mask/overview
See also NxMaskWithMaskConfig, NxMaskIbanOnlyConfig
optionalLabelstringNoText that is additionally displayed in the label if the field is not mandatory.
placeholderstringNoPlaceholder to be displayed in the field when the input is empty.
It's translatable by default and supports string interpolation.

NxMask Configuration (NxMaskWithMaskConfig)

PropertyTypeRequiredDescription
nxMaskstringYes0: digits (0 to 9 numbers)
A: letters (uppercase and lowercase), digits
S: letters (uppercase and lowercase)
Thus, if you write 000-AAA this specifies a mask that consists of three
numbers and then three letters, with a separator in the middle
convertTostringNoConvert mask, e.g. to upper case.
Default: No conversion.
dropSpecialCharactersbooleanNoRemove special characters in the value output.
Default: false
errorMessagestringNoCustom error message for validation
separatorsstring[]NoThe default separators are /, (, ), ., :, -, +, , and space.
validateMaskbooleanNoWhether the mask should be part of the validation.
Default: true

NxMask Configuration (NxMaskIbanOnlyConfig)

PropertyTypeRequiredDescription
isIbanbooleanYesBoolean to determine if input is iban type
errorMessagestringNoCustom error message for validation

Layout Properties

PropertyTypeRequiredDescription
centerAlignInRetailbooleanNoControls the field alignment for "CUSTOM_COLUMN" layout in retail journeys. Set to true to center-align the field. Defaults to left alignment.
Ignored in expert journeys and other pre-defined layouts, which always use left alignment.

4. Configuration Examples

Basic Text Input

Example :
{
  "id": "firstName",
  "type": "INPUT",
  "inputType": "text",
  "label": "First Name",
  "placeholder": "Enter your first name",
  "validators": [
    {
      "type": "REQUIRED",
      "errorMessage": "First name is required"
    }
  ]
}

Email Input

Example :
{
  "id": "email",
  "type": "INPUT",
  "inputType": "email",
  "label": "Email Address",
  "placeholder": "you@example.com",
  "validators": [
    {
      "type": "REQUIRED"
    },
    {
      "type": "EMAIL"
    }
  ]
}

Input with Prefix/Suffix

Example :
{
  "id": "insuranceAmount",
  "type": "INPUT",
  "inputType": "number",
  "label": "Insurance Amount",
  "inputPrefix": "€",
  "inputSuffix": "per year"
}

Masked Input

Example :
{
  "id": "accountNumber",
  "type": "INPUT",
  "inputType": "text",
  "label": "Account Number",
  "nxMask": {
    "nxMask": "0000-0000-0000-0000",
    "dropSpecialCharacters": true
  }
}

IBAN Input

Example :
{
  "id": "iban",
  "type": "INPUT",
  "inputType": "text",
  "label": "IBAN",
  "nxMask": {
    "isIban": true,
    "errorMessage": "Please enter a valid IBAN"
  }
}

5. API Reference

For complete API documentation, see:

For Aquila component documentation and design guidelines, see Input Field - Aquila Design System and Input Mask.

results matching ""

    No results matching ""