StandaloneSearchBox (Commerce Engine)
StandaloneSearchBox (Commerce Engine)
|
|
Note
This component was introduced in version |
Methods
afterRedirection
Resets the standalone search box state. To be dispatched on single page applications after the redirection has been triggered.
submit
Triggers a redirection.
updateRedirectUrl
Updates the redirection url of the standalone search box.
Parameters
-
url:
stringThe new URL to redirect to.
Attributes
state
A scoped and simplified part of the headless state that is relevant to the StandaloneSearchBox controller.
Properties
-
redirectTo:
stringThe URL to redirect to.
-
isLoading:
booleanDetermines if a search is in progress.
-
isLoadingSuggestions:
booleanDetermines if a query suggest request is in progress.
-
suggestions:
Suggestion[]The query suggestions for the search box query.
-
value:
stringThe current query in the search box.
Initialize
buildStandaloneSearchBox
Creates a StandaloneSearchBox controller instance.
Parameters
-
engine:
CommerceEngineThe headless commerce engine.
-
props:
StandaloneSearchBoxPropsThe configurable
StandaloneSearchBoxproperties.
Returns StandaloneSearchBox
StandaloneSearchBoxProps
The configurable StandaloneSearchBox properties.
Properties
-
options:
StandaloneSearchBoxOptions
StandaloneSearchBoxOptions
Properties
-
redirectionUrl:
stringThe default Url the user should be redirected to, when a query is submitted. If a query pipeline redirect is triggered, it will redirect to that Url instead.
-
overwrite?:
booleanWhether to overwrite the existing standalone search box with the same id.
Related types
Suggestion
Properties
-
highlightedValue:
stringThe suggestion after applying any
highlightOptions. -
rawValue:
stringThe suggestion text.