Skip to main content
Signature

Import

To ensure optimal bundle sizes, see Optimize build size.
Vue

See this widget in action

Preview this widget and its behavior.

About this widget

Virtual indices let you use relevant sort, a sorting mechanism that favors relevancy over the attribute you’re sorting on. The ais-relevant-sort widget displays the current search mode when searching in a virtual replica index, and allows users to switch between relevant and regular sorting, which is more exhaustive but can return less relevant results.

Examples

Vue

Props

object
default:"{}"
The CSS classes you can override:
  • ais-RelevantSort. The root element of the widget.
  • ais-RelevantSort-text. The text element.
  • ais-RelevantSort-button. The button element.
Vue
The slot to override the complete DOM output of the widget.When you implement this slot, none of the other slots will change the output, as the default slot surrounds them.Scope
  • isRelevantSorted: boolean. True if the current index is using Relevant sort.
  • refine: function. Function to toggle between showing relevant or all results.
Vue
The slot to override the introductory text.Scope
  • isRelevantSorted: boolean. True if the current index is Relevant sorted.
Vue
The slot to override the toggle button.Scope
  • isRelevantSorted: boolean. True if the current index is using Relevant sort.
Vue

HTML output

HTML
Last modified on July 22, 2026