Phone Number
A phone number input with optional country code and format validation.
Overview
The Phone Number field provides a dedicated input for telephone numbers. On mobile it triggers a numeric keyboard. You can configure it to accept international format (with country code prefix) or a specific national format using the pattern validation.
DynamicFormBuilder also supports Nepali number input via the nepali flag, which renders a Nepali-script numeral input widget for deployments targeting Nepali-speaking users.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| type | string | — | The field type identifier (e.g. "text", "email"). |
| label | string | — | Human-readable label shown above the field. |
| name | string | — | Unique machine name used as the data key in submissions. |
| required | boolean | false | When true the form cannot be submitted without a value. |
| placeholder | string | undefined | Ghost text shown inside the input when empty. |
| defaultValue | any | undefined | Pre-filled value when the form loads. |
| hidden | boolean | false | Hides the field from the rendered form (still submitted). |
| disabled | boolean | false | Renders the field as read-only and non-interactive. |
| description | string | undefined | Helper text displayed below the field label. |
| className | string | undefined | Additional CSS class applied to the field wrapper. |
| validation.pattern | string | undefined | Regex pattern for phone format validation. |
| validation.minLength | number | undefined | Minimum digit count. |
| validation.maxLength | number | undefined | Maximum digit count. |
| nepali | boolean | false | Enables Nepali numeral input mode. |
JSON Schema
{
"type": "phone",
"label": "Mobile Number",
"name": "mobile_number",
"required": true,
"placeholder": "+1 (555) 000-0000",
"validation": {
"pattern": "^\+?[1-9]\d{7,14}$",
"patternMessage": "Please enter a valid phone number"
}
}