Location autocomplete widget

JavaScript location autocomplete widget for forms

Add a polished city, region, and country autocomplete field without building result rows, keyboard behavior, or mobile search UI from scratch.

API

Use the API directly when your team wants complete control over request handling and rendering.

View API page

Basic JS

Attach PlaceField results to your existing input and keep full control over surrounding UI.

Copy Basic JS

Autocomplete UI for the field you actually need

The widget is built for location fields that should store city, region, and country data. It avoids address-result clutter and does not introduce a map into your form.

Use public browser keys with exact origin allowlists, and keep server keys behind your backend when you call the API yourself. For copyable starter code, see the public examples repository.

Widget example

PlaceField.widget("#city", {
  endpoint: "https://api.placefield.dev/v1/locations/autocomplete",
  key: "pf_pub_xxx",
  geoBias: "country",
  mobile: "fullscreen"
});

Browser integrations

Use the lightweight attach script for your own UI, or the full widget when you want a complete location autocomplete field.

Basic JS

Autocomplete behavior attached to an input you style yourself.

Basic JS autocomplete dropdown attached to a customer-styled location input.

Full Widget

Bundled field styling, clear button, and richer result rows.

Full Widget autocomplete dropdown with clear button and structured location result rows.

Fullscreen mobile search

Optional focused mobile mode for forms where completion quality matters.

Animated fullscreen mobile PlaceField search flow opening from a location input and showing matching location results.

Tell us about your widget integration

Share the form, site, and whether you want Basic JS, the Full Widget, or both.