Overview
The Search Results List component is a wrapper around a group of Search Results Item components.
Selector
The selector for this component is <hawksearch-results-list>
.
Data Model
The following data model is exposed to the Handlebars template:
{ items: Array<SearchResultsItem>; }
For more information, see Search Results Items.
type SearchResultsItemType = 'content' | 'product';
interface SearchResultsItem {
attributes?: {
[key: string]: Array<string>;
};
description?: string;
id: string;
imageUrl?: string;
pinned: boolean;
price?: number;
salePrice?: number;
score: number;
title: string;
type: SearchResultsItemType;
url: string;
visible: boolean;
}
Default Template
<div class='row'> {{#each items}} {{#if (eq type 'content')}} <div class='column column--12'> <hawksearch-results-item></hawksearch-results-item> </div> {{else}} <div class='column column--12 column-sm--6 column-lg--4'> <hawksearch-results-item></hawksearch-results-item> </div> {{/if}} {{/each}} </div>