Highlighting matched text helps readers understand why a result appeared. Preserve the original label and avoid interpreting a search term as markup.
Worked example
<div class="box stack">
<p class="kicker">Documentation</p>
<h2>Install the client</h2>
<p>Use the <mark>client</mark> package to connect your application.</p>
</div>Implementation notes
Highlight spans should preserve the complete accessible name of a result. Splitting the text across styling wrappers must not alter the word sequence.
Try it yourself
Search for punctuation and for a term that appears twice.
Open the UI Components example →Editorial date July 2, 2026 · Published December 6, 2026