Calm motion: animations on this site only fade, with no movement
Place search
A search for places with results that show the address and the distance
Finds a shop, a station, or an address, often above a map with pins. For a choice from a fixed list, use the combobox.
Basic
Type kopi, studio, or pasar.
searchis your function. It gets the text and returns a promise of places. Each place has anid, aname, and optionaladdress,distancein meters, andkind.- The search starts after
min-lengthcharacters (default 2) and a wait ofdelaymilliseconds after the last key (default 250). If an older search ends after a newer one, its answer is dropped. - The field is a combobox. The Down and Up arrow keys move through the results, Enter picks one, and Escape closes the list.
v-modelis the chosen place. The field then shows its name.- If the parent sets the place later, for example a saved address, the field shows its name.
- A status line says "Searching…", the number of places, "No places found.", or an error. Screen readers hear it.
localeformats the distances. Change the words withlabelsor a label pack. The API table lists the keys.
Usage
ts
import { BlessPlaceSearch } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
search* | (query: string) => Promise<BlessPlace[]> | — | your search: it gets the text and returns the places |
delay | number | 250 | the wait after the last key before a search, in milliseconds |
minLength | number | 2 | |
locale | string | "en" | |
labels | Partial<{ label: string; placeholder: string; searching: string; results: (n: number) => string; none: string; failed: string; }> | — | |
modelValue | BlessPlace | null | null |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: BlessPlace | null] |