ais-current-refinements
<ais-current-refinements // Optional parameters :included-attributes="string[]" :excluded-attributes="string[]" :transform-items="function" :class-names="object" />
1
2
3
4
5
6
7
8
9
import { AisCurrentRefinements } from 'vue-instantsearch';
// Use 'vue-instantsearch/vue3/es' for Vue 3
export default {
components: {
AisCurrentRefinements
},
// ...
};
1. Follow additional steps in Optimize build size to ensure your code is correctly bundled.
2. This imports all the widgets, even the ones you donโt use. Read the Getting started guide for more information.
About this widget
The ais-current-refinements
widget displays a list of refinements applied to the search.
Examples
1
<ais-current-refinements />
Props
Parameter | Description | ||
---|---|---|---|
included-attributes
|
type: string[]
Optional
The attributes to include in the widget (all by default). Canโt be used with |
||
Copy
|
|||
excluded-attributes
|
type: string[]
default: ["query"]
Optional
The attributes to exclude from the widget. Canโt be used with |
||
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 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
|
|||
class-names
|
type: object
default: {}
Optional
The CSS classes you can override:
|
||
Copy
|
Customize the UI
Parameter | Description | ||
---|---|---|---|
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
Where an item is an
Where each refinement is an
|
||
Copy
|
|||
item
|
The slot to override the DOM output of an item. Scope
Where item is an
Where each refinement is an
|
||
Copy
|
|||
refinement
|
The slot to override the DOM output of a single refinement. Scope
Where refinement is an
|
||
Copy
|
HTML output
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<div class="ais-CurrentRefinements">
<ul class="ais-CurrentRefinements-list">
<li class="ais-CurrentRefinements-itemt">
<span class="ais-CurrentRefinements-label">
Category:
</span>
<span class="ais-CurrentRefinements-category">
<span class="ais-CurrentRefinements-categoryLabel">
Movies & TV Shows
</span>
<button class="ais-CurrentRefinements-delete">โ</button>
</span>
<span class="ais-CurrentRefinements-category">
<span class="ais-CurrentRefinements-categoryLabel">
Others
</span>
<button class="ais-CurrentRefinements-delete">โ</button>
</span>
</li>
<li class="ais-CurrentRefinements-item">
<span class="ais-CurrentRefinements-label">
Brand:
</span>
<span class="ais-CurrentRefinements-category">
<span class="ais-CurrentRefinements-categoryLabel">
Algolia
</span>
<button class="ais-CurrentRefinements-delete">โ</button>
</span>
</li>
</ul>
</div>