ais-toggle-refinement
<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
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. Note that when you implement this slot, none of the other slots will change the output, as the default slot surrounds them. Scope
|
||
Copy
|
HTML output
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>