Embed types
Search results
Embed search results in your app
Usage
Pre-filtering with searchParams
You can also give search params that should be used as the default, this allows you to preselect filters. For example, you can show only hotels in a certain city.
Given the following url: https://demo.travelbase.nl/nl/search?accommodationType=_rental-unit-type.room?orFilters=_place.id-1-brand-oberon, you would pass the following searchParams:
or, simply as a string: ?accommodationType=_rental-unit-type.room?orFilters=_place.id-1-brand-oberon
Options
| Prop | Type | Default |
|---|---|---|
searchParams | string | Record<string, string> | '' |
viewType | "map" | "list" | 'list' |
enableFilters | boolean | true |
enableSearch | boolean | true |
enableSort | boolean | true |
enableViewType | boolean | true |
Callbacks
| Prop | Type | Default |
|---|---|---|
onHitClick | (unit: { slug: string; id: string; }, searchParams: string) => void | - |