Components
LocationInput
Location autocomplete input with a dropdown of suggestions for city or
address search. The geocoder is injected: pass search (query to
suggestions) and resolve (suggestion to full Location). Queries are
debounced by 300ms and start at two characters.
Usage
Best practices
searchandresolveare required - the component has no built-in geocoder. Wrap your provider (Google Places, Mapbox, your own API) in those two functions.searchmay reject; the dropdown then shows no suggestions. Returnnullfromresolveto ignore a selection.Pick
mode="city"vs"address"to scope the geocoding; drive it controlled via theLocationvalue+onChange(which also fires on clear).
Props
Also exports
- interface
Location - type
LocationMode - type
LocationResolve - type
LocationSearch - interface
LocationSuggestion