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

Displays the highlighted attributes of your search results. It isn’t a widget but a helper function that works with the ais-hits or ais-infinite-hits widgets.

Examples

Basic usage

Vue

Access a nested property

Given this record:
JSON
Access the highlighted version by specifying the path separating levels with dots:
Vue

Props

string
required
The highlighted attribute.Specify a dot-separated value for nested objects, like actor.name.
Vue
object
required
The original hit object provided to the function. It contains all the data for that result, including the highlighted parts.
The hit object must have a _highlightResult[attribute].value property.
Vue
string
default:"mark"
The HTML element that wraps the highlight.
Vue
object
default:"{}"
To customize the appearance, override the appropriate class in your widget theme.
  • ais-Highlight. The root element of the widget.
  • ais-Highlight-highlighted. The highlighted part.
Vue

HTML output

HTML
Last modified on July 22, 2026