Skip to main content

Allows searching for arbitrary results from a search box.


const user = await"Search for a user", {
renderResult: user => ({
imageUrl: user.avatar,
onSearch: async query => {
return users.find(query);


helpTextOptional stringOptional label providing additonal context.
initialResultsRequired array of objectsArray of underlying data object, can be anything.
onSearchRequired async functionReceives a search query string as argument, returns arbitrary data objects.
placeholderOptional stringText to display in the input when no value is set.
renderResultRequired functionReceives a single data object from `onSearch` as argument, must return either a string, or an object with a required `label` property and optional `description` and `imageUrl` properties.

Returns: The underlying result object that was selected.

Was this section useful?
On this page