The Search Component
Description
Description
This is a search component for TUI 6M. Its purpose is to demonstrate how such a component can be laid out. At the same time, it serves as a boilerplate for “real” 6M components.
Screenshots
The default view of the component.
Meta
Maintainer | picr-developmentb2c-tuicom@tui.com |
---|---|
Locales |
de-DE , fr-FR
|
Usage
Add the following script tag (or something similar) to your web page to have the component load. Note: This is required only once per webpage, even when you embed multiple instances of the component.
<script src="https://cloud.tui.com/6m/search/tui-search/master/main.js" async defer></script>
Add the following HTML code anywhere in your webpage at the position where you want the component to show. You can create multiple instances of the component.
<tui-search></tui-search>
Read more about using components ›
Attributes
This component can be configured with the following attributes:
Name | Description | Allowed Values | Default | Required |
---|---|---|---|---|
suggestions |
Toggle Suggestions List On/Off |
true |
no | |
suggestionLimit |
Limit how many suggestions are fetched |
10 |
no | |
suggestionsMobile |
Limit how many suggestions are shown on mobile devices |
3 |
no | |
suggestionsDesktop |
Limit how many suggestions are shown on desktop devices |
10 |
no | |
sticky |
Toggle Sticky Behaviour On/Off |
false |
no |
Events
Event | tui-search.search_update |
|||||
---|---|---|---|---|---|---|
Type | publish | |||||
Description | Triggers when filters are updated. |
|||||
Payload |
The payload object of this event has the following properties:
|
Event | tui-search.query_update |
|||||||
---|---|---|---|---|---|---|---|---|
Type | publish | |||||||
Description | Triggers when search query is updated. |
|||||||
Payload |
The payload object of this event has the following properties:
|
Event | tui-search.used_suggestion |
|||||||
---|---|---|---|---|---|---|---|---|
Type | publish | |||||||
Description | Triggers when user accepts a suggestion. |
|||||||
Payload |
The payload object of this event has the following properties:
|
Event | tui-search.used_suggestion_object |
|||||
---|---|---|---|---|---|---|
Type | publish | |||||
Description | Triggers when user accepts a suggestion. |
|||||
Payload |
The payload object of this event has the following properties:
|
Event | tui-search.input_focus |
---|---|
Type | publish |
Description | Triggers when user clicks on the input field or otherwise focuses it. |
Payload | none |
Event | tui-search.suggestion_update |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type | publish | ||||||||||||||||||
Description | Triggers after query update when updated list of suggestions is available. |
||||||||||||||||||
Payload |
The payload object of this event has the following properties:
|