Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Basic components
Autocomplete
vtex.search
Version: 1.0.8
Latest version: 2.18.1

This page is about version 1.0.8 of the app, which is not the most recent version. The latest stable version is 2.18.1.

Description

Autocomplete is an alternative for the default VTEX autocomplete. It includes:

  • Top Searches.
  • Search History.
  • Product Suggestions.
  • Term Suggestions.

You can read a detailed explanation of Autocomplete and it's features here.

Usage

Add autocomplete-result-list.v2 into the blocks of a search-bar. We also recommend to set openAutocompleteOnFocus as shown.


_11
{
_11
"autocomplete-result-list.v2": {
_11
"blocks": ["product-summary"]
_11
},
_11
"search-bar": {
_11
"blocks": ["autocomplete-result-list.v2"],
_11
"props": {
_11
"openAutocompleteOnFocus": true
_11
}
_11
}
_11
}

Props

Prop nameTypeDescriptionDefault value
maxTopSearchesNumberMaximum number of terms in the top searches list10
maxHistoryNumberMaximum number of terms in the search history list5
maxSuggestedProductsNumberMaximum number of suggested products3
maxSuggestedTermsNumberMaximum number of suggested terms3
autocompleteWidthNumberAutocomplete width. Number between 0 and 100-
productLayoutProductLayoutEnumDefines the product layout in the suggested products list-
hideTitlesBooleanIf true, all the titles will be hiddenfalse
historyFirstBooleanIf true, the history list will be prioritizedfalse
customBreakpointsCustomBreakpointsPropDefines a maximum number of suggested products by breakpoints-

ProductLayoutEnum

Enum nameEnum value
HorizontalHORIZONTAL
VerticalVERTICAL

CustomBreakpointsProp

Prop nameTypeDescriptionDefault value
mdBreakpointPropDefines the options for the md breakpoint-
lgBreakpointPropDefines the options for the lg breakpoint-
xlgBreakpointPropDefines the options for the xlg breakpoint-

BreakpointProp

Prop nameTypeDescriptionDefault value
widthNumberMinimum width for the breakpoint-
maxSuggestedProductsNumberMaximum number of suggested products for the breakpoint-
See also
Vtex.search
VTEX IO Apps
VTEX App Store
VTEX IO Apps