The PHONE_INPUT component provides a specialized input field for phone numbers with country code selection and validation.
🛝 Use the Dynamic Form Playground to see the Phone Input component in action and try out different configurations
| Property | Type | Required | Description |
|---|---|---|---|
type | 'PHONE_INPUT' | Yes | Specifies the field type as PHONE_INPUT. |
id | string | Yes | Unique identifier for the field. The field's value is stored in the form state under this key. |
renderName | string | No | Optional name added as data-render-name attribute to locate the rendered element in the DOM. |
label | string | Yes | Label text displayed above the field. Supports translation and string interpolation. |
value | string | No | The field's initial value including country code (e.g., "+49123456789"). If set, the field will be pre-filled with this value. |
hint | string | No | Additional hint text displayed below the field. |
note | string | No | Informational note displayed when there are no errors. |
infoIcon | DfInfoIconConfig | No | Info icon with popover. Object with popoverText (string, required) and popoverDirection ('top', 'bottom', 'left', 'right'). |
validators | array | No | Validation rules for the field. Common types: REQUIRED, PATTERN, MIN_LENGTH, MAX_LENGTH. The component has built-in phone number validation based on country. Each validator has type and optional errorMessage. |
testId | string | No | Test identifier for automated testing. Set as data-testid attribute. |
acl | array | No | Access control rules for field visibility/editability. Each rule has state ('hidden', 'readonly', 'disabled', 'visible', 'editable') and optional condition (Filtrex expression). |
columnSpan | number | No | Number 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. |
spacing | string | No | Margin spacing before next field: 'NONE' (0px), 'XS' (8px), 'S' (16px), 'M' (24px), 'L' (32px), 'XL' (40px), 'XXL' (48px). |
| Property | Type | Required | Description |
|---|---|---|---|
areaCodeLabel | string | No | Set the text at the top of the dropdown and aria-label of area code field. The default value is 'Area Code'. |
countryCode | string | No | The default country code for the phone input. |
errorMessage | string | No | Custom error message for validation |
lineNumberLabel | string | No | The aria-label of line number field. |
placeholder | string | No | Placeholder to be displayed in the field when the input is empty. It's translatable by default and supports string interpolation. |
{
"id": "phoneNumber",
"type": "PHONE_INPUT",
"label": "Phone Number",
"placeholder": "Enter your phone number",
"countryCode": "DE",
"validators": [
{
"type": "REQUIRED",
"errorMessage": "Phone number is required"
}
]
}{
"id": "contactNumber",
"type": "PHONE_INPUT",
"label": "Contact Number",
"placeholder": "Enter phone number",
"countryCode": "DE",
"areaCodeLabel": "Country Code",
"lineNumberLabel": "Phone Number",
"validators": [
{
"type": "REQUIRED"
}
]
}{
"id": "emergencyContact",
"type": "PHONE_INPUT",
"label": "Emergency Contact",
"placeholder": "Enter phone number",
"countryCode": "AT",
"errorMessage": "Please provide a valid emergency contact number",
"validators": [
{
"type": "REQUIRED"
}
]
}{
"id": "germanPhoneNumber",
"type": "PHONE_INPUT",
"label": "German Phone Number",
"placeholder": "Enter German phone number",
"countryCode": "DE",
"validators": [
{
"type": "PATTERN",
"pattern": "^\\+49[0-9]{10,11}$",
"errorMessage": "Must be a German phone number starting with +49"
},
{
"type": "REQUIRED",
"errorMessage": "Phone number is required"
}
]
}{
"id": "businessPhone",
"type": "PHONE_INPUT",
"label": "Business Phone",
"placeholder": "Enter business phone",
"value": "+49301234567",
"countryCode": "DE",
"validators": [
{
"type": "REQUIRED",
"errorMessage": "Business phone is required"
}
]
}For complete API documentation, see DfPhoneInputConfig.
For Aquila component documentation and design guidelines, see Phone Input - Aquila Design System.