UK Address Field
Structured address input for collecting UK postal addresses.
When usePostcodeLookup is enabled, the component uses the Ordnance Survey API to find addresses by postcode. This requires the ordnanceSurveyApiKey and ordnanceSurveyApiSecret plugin options to be set — without them the component falls back to the manual address entry form regardless of the usePostcodeLookup setting.
Preview
With postcode lookup
Without postcode lookup
JSON definition
{ "type": "UkAddressField", "name": "fieldName", "title": "Question title", "hint": "", "shortDescription": "", "options": {}}Properties
| Property | Type | Required | Description |
|---|---|---|---|
hint | string | No | Hint text displayed below the field label to help the user answer the question. |
shortDescription | string | No | A short description of the field used in the check-your-answers summary. |
Options
| Property | Type | Required | Description |
|---|---|---|---|
classes | string | No | Additional CSS classes applied to the component. |
customValidationMessages | object | No | A map of Joi error codes to custom error messages. |
hideTitle | boolean | No | When true, hides the component or section title. |
instructionText | string | No | Alternative text read by screen readers in place of the field title. |
optionalText | boolean | No | When true, appends '(optional)' to the field label. |
required | boolean | No | Whether the field must be filled in. Defaults to true. |
usePostcodeLookup | boolean | No | When true, enables a postcode lookup integration. |