# Google Address Autocomplete

The live `googleAddress` field is a text input enhanced by `google.maps.places.Autocomplete`.

## Common Configuration Properties

| Property                      | Type       | Description                                          |
| ----------------------------- | ---------- | ---------------------------------------------------- |
| `type`                        | `String`   | Must be `"googleAddress"`                            |
| `label`                       | `String`   | Field label                                          |
| `model`                       | `String`   | Model key that stores the selected formatted address |
| `placeholder`                 | `String`   | Placeholder text                                     |
| `disabled`                    | `Boolean`  | Disables the input                                   |
| `readonly`                    | `Boolean`  | Makes the input read-only                            |
| `fieldOptions.onPlaceChanged` | `Function` | Optional callback fired after a place is selected    |

## Runtime Notes

* The component requires the Google Maps JavaScript API with the `places` library loaded globally.
* The model value is set to `place.formatted_address`.
* On focus, the component attempts to use browser geolocation to bias autocomplete results near the user.
* The autocomplete instance is created with `types: ["geocode"]`.

If `fieldOptions.onPlaceChanged` is provided, it is called with:

```
(formattedAddress, parsedAddressData, place, model, schema)
```

`parsedAddressData` may include keys such as:

* `street_number`
* `route`
* `country`
* `administrative_area_level_1`
* `administrative_area_level_2`
* `locality`
* `postal_code`

## Example Schema Snippet

```json
{
  "type": "googleAddress",
  "label": "Street Address",
  "model": "userAddress",
  "placeholder": "Start typing your address..."
}
```

## Full Property Reference

This element is implemented in the sibling `vue-form-generator` source as `fieldGoogleAddress.vue` and uses the Google Places Autocomplete API.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klai.studio/reference/components-overview/betterforms-elements/googleaddress.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
