Appearance
io.search
Represents a search component.
Usage
ts
const value = await io.search("Search for Order ID". {
renderResult: order => ({
label: order.id,
description: order.notes,
image: {
url: order.image,
size: "small",
},
}),
onSearch: async query => {
return orders.filter(order => order.includes(query));
},
})
python
async def render_result(order):
return {
"label": order["id"],
"description": order["notes"],
"image": {
"url": order["image"],
"size": "small"
}
}
async def on_search(query):
return [order for order in orders if query in order]
value = await io.search(
"Search for Order ID",
render_result=render_result,
on_search=on_search
)