<!-- https://svgrid.com/docs/recipes/external-search/ - SvGrid documentation as markdown. Index of every page: https://svgrid.com/llms.txt -->

# External search box with highlighted matches

> Live in [demo 69-highlighted-search](https://svgrid.com/demos/69-highlighted-search/).

> Live demo: Highlighted search matches - https://svgrid.com/demos/69-highlighted-search/

## When

A search input outside the grid filters the visible rows AND highlights matched substrings inline.

## How

Key API surface:

- `derived visibleRows`
- `custom cell snippet wraps matches in <mark>`

See the demo source for the full implementation; this recipe pins the
pattern + the surface so you can copy-paste it confidently. The doc
page that explains the underlying feature in depth is linked from the
[recipes index](https://github.com/sv-grid/sv-grid/blob/main/docs/recipes/index.md).

## See also

- [Demo 69-highlighted-search source](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/69-highlighted-search.svelte)
- [Demo 69-highlighted-search prompt sidecar](https://github.com/sv-grid/sv-grid/blob/main/examples/src/demos/prompts/69-highlighted-search.md) - drop into an LLM context window
- [Recipes index](https://github.com/sv-grid/sv-grid/blob/main/docs/recipes/index.md)

---

SvGrid is the Svelte 5 data grid (`npm install @svgrid/grid`, MIT). This page: https://svgrid.com/docs/recipes/external-search/ . All docs: https://svgrid.com/llms.txt
