Signature
About this widget
Displays the highlighted attributes of your search results. It isn’t a widget but a component available from thehits
or infiniteHits
widgets templates.
Examples
JavaScript
Options
The highlighted attribute.Specify a dot-separated value for nested objects, like
actor.name
JavaScript
The original
hit
object
provided to the function.
It contains all the data for that result, including the highlighted parts.The
hit
object must contain a _highlightResult[attribute].value
property.JavaScript
The HTML element that wraps the highlight.
JavaScript
The HTML element that wraps the non-highlighted parts of the string.
JavaScript
The character between each item when the attribute to highlight is an array.
JavaScript
The CSS classes you can override:
root
. The component’s root element.highlighted
. The highlighted parts.nonHighlighted
. The non-highlighted parts.separator
. The separator elements between highlighted parts.
JavaScript
HTML output
HTML