InstantSearch specs

✏️ edit page

RelatedProducts

Widget example

Related products

  1. Hit 5477500: Amazon - Fire TV Stick with Alexa Voice Remote - Black
  2. Hit 4397400: Google - Chromecast - Black
  3. Hit 4397400: Google - Chromecast - Black
  4. Hit 5477500: Amazon - Fire TV Stick with Alexa Voice Remote - Black
  5. Hit 4397400: Google - Chromecast - Black
  6. Hit 4397400: Google - Chromecast - Black
  7. Hit 5477500: Amazon - Fire TV Stick with Alexa Voice Remote - Black
  8. Hit 4397400: Google - Chromecast - Black

HTML output

<div class="ais-RelatedProducts">
  <h3 class="ais-RelatedProducts-title">Related products</h3>
  <div class="ais-RelatedProducts-container">
    <ol class="ais-RelatedProducts-list">
      <li class="ais-RelatedProducts-item">
        Hit 5477500: Amazon - Fire TV Stick with Alexa Voice Remote - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 4397400: Google - Chromecast - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 4397400: Google - Chromecast - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 5477500: Amazon - Fire TV Stick with Alexa Voice Remote - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 4397400: Google - Chromecast - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 4397400: Google - Chromecast - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 5477500: Amazon - Fire TV Stick with Alexa Voice Remote - Black
      </li>
      <li class="ais-RelatedProducts-item">
        Hit 4397400: Google - Chromecast - Black
      </li>
    </ol>
  </div>
</div>

CSS classes

Hint: hover classes below to see their position.

name description
.ais-RelatedProducts the root div of the widget
.ais-RelatedProducts-title the title heading of the widget
.ais-RelatedProducts-container the container for the list of results
.ais-RelatedProducts-list the list of results
.ais-RelatedProducts-item the hit list item

Options

Note: this is a guideline for new InstantSearch flavours, not a rule.

name default value description
objectIDs objectIDs of the items to get the Related Products items from
limit Number of recommendations to retrieve
fallbackParameters List of search parameters to send as additional filters to use as fallback when there aren't enough recommendations.
queryParameters List of search parameters to send
threshold Threshold for the recommendations confidence score (between 0 and 100)
transformItems Function which receives the items, which will be called before displaying them. Should return a new array with the same shape as the original array. Useful for mapping over the items to transform, remove or reorder them

Translations

Note: this is a guideline for new InstantSearch flavours, not a rule.

name default value description
title Related products The text for the header element
sliderLabel Related products The label for the horizontal slider