Patterns · Pages
Search results
SearchResultsPageSearchScreen
Search results: the query field, result types as tabs, a count that is announced, the query marked in titles and excerpts, paging, and suggestions when nothing matches.
Web
Live, at a real viewport width. Switch to Phone to see the responsive layout.
Usage
import { SearchResultsPage } from '@nexub/patterns';
<SearchResultsPage
query={query}
onQueryChange={setQuery}
onSubmit={search}
results={results}
total={total}
page={page}
pageSize={10}
onPageChange={setPage}
kinds={[{ id: 'all', label: 'All', count: total }, { id: 'people', label: 'People' }]}
kind={kind}
onKindChange={setKind}
suggestions={['invoice', 'invoice template']}
loading={isLoading}
/>On iOS & Android: SearchScreen
@nexub/react-native/patternsAlpha
import { SearchScreen } from '@nexub/react-native/patterns';
<SearchScreen query={query} onQueryChange={setQuery} results={results} renderResult={(r: Result) => <ResultRow result={r} />} keyOf={(r: Result) => r.id} recent={recent} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Results | A fixed result card: title link, excerpt, meta and type. | You render each row (renderResult). |
| Before typing | The page starts from a query. | Recent searches show until there is a query (recent). |
| Paging | Numbered pages. | One scrolling list. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
SearchScreen props
| Prop | Type | Default | Description |
|---|---|---|---|
| queryrequired | string | — | — |
| onQueryChangerequired | (q: string) => void | — | — |
| resultsrequired | T[] | — | — |
| renderResultrequired | (item: T) => React.ReactNode | — | — |
| keyOfrequired | (item: T) => string | — | — |
| recent | string[] | [] | — |
| placeholder | string | — | — |