v2.0.2
Search
Search primitives expose SSR-safe markup that hydrates into a FlexSearch-powered client app. Use <Search /> for the default layout or mix the smaller components to control every region of the page.
<Search />Props
| Component | Prop | Type | Notes |
|---|---|---|---|
Search | layout | string | Optional layout override for the results region ('grid' or 'list'). |
SearchSummary | className | string | Finely control typography above the results. |
SearchResults | layout | string | Choose between 'grid' (masonry) and 'list' (stacked cards). |
SearchResults | headingLevel | number | The level of each page result's title, 2 to 6. By default one below the last heading before the results: 2 under the page's h1. |
SearchTabs | className | string | Style the per-type tabs. |
SearchFormModal | mode | 'dialog' \/ 'inline' | Render the search drawer in dialog or inline form mode. |
Every component reads from the same client store and URL params, so you can scatter them around the layout without extra plumbing.
Examples
Custom layout
Compose your own layout inside content/search/_layout.mdx. The header's search field drives
the results, so the layout needs no field of its own; open it with the page's h1.
content/search/_layout.mdx
<section className="space-y-6"> <header className="space-y-2"> <h1>Search</h1> <p>Browse works and documentation pages from the Northwestern collections.</p> </header> <SearchTabs /> <SearchSummary /></section> <SearchResults layout="grid" />List layout
Flip to a list view when you need dense metadata instead of masonry cards.
<SearchResults layout="list" />Modal trigger
Use the modal helper when you need a search trigger outside the main page tree, such as the global header.
<SearchFormModal mode="dialog"> <button type="button" className="btn">Open search</button></SearchFormModal>