SearchArea recipe
Source: 02_SearchArea/ · three flavours of SearchArea shown side-by-side in a Pivot so you can compare them.
How it looks
A search box, a facet sidebar, and a column of result cards. The real SearchArea queries the workspace; the runnable Tesserae preview below sketches the same layout with static data.
What it teaches
- Default —
SearchArea()with nothing customised. Hits the workspace's default search endpoint and renders the standard result cards. - With facets — Pre-filter the query with
OnSearch(sr => sr.SetBeforeTypesFacet("..."))and enable the facet sidebar with.WithFacets(). The right starting point for "search inside a single node type". - Custom row — Adjust the search-result row with
Renderer(r => r.CustomizeResult(result => ...)). You receive the row the node type built, with the search's own marks already on it, and return the same row or another one. Use this when you need a denser list, custom row commands, or to surface fields the default row doesn't show. - Appending a button next to the search box with
SearchBox(b => b.AppendToSearchBox(...)).
Three flavours
// 1. Default
SearchArea()
// 2. Filter to one node type + facet sidebar
SearchArea()
.OnSearch(sr => sr.SetBeforeTypesFacet(nameof(MyNodeType)))
.WithFacets()
// 3. Customize the result row
SearchArea()
.Renderer(r => r.CustomizeResult(result => result
.SetText(null)
.InlineCommands(Button().SetIcon(UIcons.Plus).OnClick(() => Select(result.Result)))))
.SearchBox(b => b.AppendToSearchBox(Button("Action").SetIcon(UIcons.Bolt)))
See also
- Migrating to
OmniResult— the recipes for whatWithCardCustomizer/WithCustomizedRenderer/WithRendererused to do. Omni Result— every slot and option on the rowCustomizeResulthands you.- The Connector Recipes cover how to ingest the data this search area queries.