Edit page
Home
Getting Started
Components
Forms
AddressSmartInputAPIDefault usageWithout smartLocationInputResults with provided lat , lng and restriction propsManipulating valueWith default valueWith custom onPlaceClickWith regions filteringManual address inputAsyncCreatableSelectAsyncSelectCheckboxCreatableSelectCurrencyInputDropzoneDropzoneImagesFormErrorFormLabelImageCropInputGroupNumberInputPasswordInputPhoneInputRadioSelectSliderInputTextInputTextMaskInputTextareaToggle
Typography
Utilities
Visualization Components

AddressSmartInput

Enhanced TextInput by Google Places AutoComplete service.

Note: When smartLocationInput is true (by default) keep in mind that country's state autocompletion for some countries may not match values between GeoNames and Google Places AutoComplete. That is because Google Places do not use ISO3166_2 standard for naming first level administrative areas. Nonetheless user can still manually select the state.

Note: When radius is provided, lat/lng props must be provided as well.

Note: Neighborhood field is only visible in Manual view and if countryCode is set to US or CA.

API

Note: fetched countries and country states are saved in session storage

Default usage

{
"country": "US",
}

Without smartLocationInput

{
"country": "US",
}

Results with provided lat, lng and restriction props

Coords are pointed to the center of Warsaw, Poland.

Default radius: 1000meters. You can change it by providing radius prop.

Manipulating value

{
"country": "US",
}

With default value

Default value must be at least 2 characters long to trigger Google Places search.

{
"address": "keller-williams",
"country": "US",
}

With custom onPlaceClick

Open browser DevTools to see the clicked result object.

{
"country": "US",
}

With regions filtering

Types supported in place autocomplete requests

Manual address input

On submit overrides current address.

State is required if country is big enough to have states. For example United States will have state field as required while Antarctica won't.