Wrote an article
🔎 Use Web APIs to highlight site search results in your React app. We use semantic HTML to highlight text and the Web API for UX enhancements. You can use code with NextJS or even GatsbyJS. Hope you find it useful.

https://rodneylab.com/highlight-search-results/