API Reference
/
Vue InstantSearch Widgets
/
ais-toggle-refinement
Sep. 02, 2020
ais-toggle-refinement
Widget signature
<ais-toggle-refinement attribute="string" label="string" // Optional parameters :on="string|number|boolean" :off="string|number|boolean" :class-names="object" />
About this widget
The ais-toggle-refinement
widget provides an on/off filtering feature based on an attribute value.
Examples
Copy
1
2
3
4
<ais-toggle-refinement
attribute="free_shipping"
label="Free Shipping"
/>
Props
attribute
|
type: string
Required
The name of the attribute on which to apply the refinement. |
||
Copy
|
|||
label
|
type: string
Required
The label to display for the checkbox. |
||
Copy
|
|||
on
|
type: string|number|boolean
default: true
Optional
The value of the refinement to apply on the attribute when checked. |
||
Copy
|
|||
off
|
type: string|number|boolean
Optional
The value of the refinement to apply on the attribute when unchecked. |
||
Copy
|
|||
class-names
|
type: object
default: {}
Optional
The CSS classes to override.
|
||
Copy
|
Customize the UI
default
|
The slot to override the complete DOM output of the widget. Scope
|
||
Copy
|
HTML output
Copy
1
2
3
4
5
6
7
<div class="ais-ToggleRefinement">
<label class="ais-ToggleRefinement-label">
<input class="ais-ToggleRefinement-checkbox" type="checkbox" />
<span class="ais-ToggleRefinement-labelText">Free Shipping</span>
<span class="ais-ToggleRefinement-count">18,013</span>
</label>
</div>