ais-hits
<ais-hits // Optional parameters :escapeHTML="boolean" :class-names="object" :transform-items="function" />
About this widget
Use the ais-hits
widget to display a list of results.
To configure the number of hits to show, use the ais-hits-per-page
widget or the ais-configure
widget.
For guidance on how to search across more than one index, read the multi-index search guide.
Examples
1
<ais-hits />
Props
escapeHTML
|
type: boolean
default: true
Optional
Whether to escape HTML entities from hits string values. |
||
Copy
|
|||
class-names
|
type: object
default: {}
Optional
The CSS classes to override.
|
||
Copy
|
|||
transform-items
|
type: function
default: items => items
Optional
Receives the items and is called before displaying them. Should return a new array with the same shape as the original array. Useful for transforming, removing, or reordering items. In addition, the full If you’re transforming an attribute using the When using an array, take steps to avoid creating infinite loops. When you use an array as a prop, it causes the widget to re-register on every render, and this can sometimes cause these infinite loops. |
||
Copy
|
Customize the UI
default
|
The slot to override the complete DOM output of the widget. Note that when you implement this slot, none of the other slots will change the output, as the default slot surrounds them. Scope
|
||
Copy
|
|||
item
|
The slot to override the DOM output of the item. Scope
|
||
Copy
|
HTML output
1
2
3
4
5
6
7
8
9
10
11
12
13
<div class="ais-Hits">
<ol class="ais-Hits-list">
<li class="ais-Hits-item">
...
</li>
<li class="ais-Hits-item">
...
</li>
<li class="ais-Hits-item">
...
</li>
</ol>
</div>
Sending Click and Conversion events
Please refer to the guide on Sending Insight Events to learn about sending events from any InstantSearch widget.