Search UI for React
Your search page, ready to put together.
intrface is Indx’s search interface: the search field, filters with live counts, results and pages, and an answer agent in the same field, as React components on npm. Arranged for you in three layouts, and open for your own parts.
Search, filters and the answer agent
Any framework
The search isn’t tied to React, and the controls can be your own
The search itself runs without React or styles, for Vue, Svelte or a plain page. For your own controls, intrface works with UI SDK, a library of accessible components and behaviours that renders in React, Vue, Svelte, Solid and Web Components, and that AI agents can operate.
The search on its own
createSearch holds the text, the filters, the order and the results, sends the searches and drops answers that arrive too late. Subscribe, render what it holds, call its actions. Its snapshot works with any store that compares by reference.
Your controls, the same search
The bindings hand each control the search as a value, a change and its items: the text, a field’s values with their counts, a range, the order, the results. Use UI SDK’s components, or Base UI’s or Radix’s. UI SDK’s are visible to agents already, so with them SearchAgent is all a page needs to be one agents can operate.
| Framework | The search, connected with | Ready-made controls |
|---|---|---|
| React | useSyncExternalStore | intrface’s components, or UI SDK’s |
| Vue | shallowRef | UI SDK’s |
| Svelte | readable | UI SDK’s |
| Solid | subscribe() | UI SDK’s |
| Web Components | subscribe() | UI SDK’s |
| A plain page | subscribe() | Your own |
What stands out
More than a search box and a list
- 01 · Auto filters
The filter column, from your data
AutoFilters builds the filters from the dataset itself: a list for text, a range for numbers, a switch for true and false, a category menu for the levels you name. Fields that can’t be a useful filter are left out, and the names are made readable. Where the dataset’s owner has set its filters in the console, it shows those. A panel can also wait until it applies: shoe size is noise on an empty search of a whole shop, and the first thing wanted once the results are running shoes. It arrives at the foot of the column, so nothing on screen moves, or sits folded from the start and unfolds in its place.
- 02 · For agents
A page agents can operate
Wrapped in SearchAgent, your search page is one AI agents can read and work as data, through UI SDK’s agent bridge: your own assistant, or the visitor’s browser agent, with your rules on what they may do. Their searches can be counted apart from people’s.
- 03 · The search in the address
Back, Forward and a link that works
With routing on, the text, the filters, the order and the page live in the address. Back steps through what the visitor searched, a reload keeps their place, and a shared link opens the same search.
- 04 · Statistics
What people search for, and choose
The server counts the searches, a visitor typing a word as one search rather than one per letter, and select() reports the result they opened. The console’s Statistics shows what is searched for, what finds nothing and what is chosen. No cookie is set.
The code
One component, three layouts
SearchLayout arranges the parts for where your search lives: inside another page, a page of its own, or a box in your site’s header. Each area takes intrface’s parts or your own.
import { SearchProvider, SearchLayout, SearchResults,
ValueFilterPanel, SortByPanel, ActiveFiltersPanel } from '@indxsearch/intrface';
<SearchProvider url={url} team={team} dataset="products" preAuthenticatedToken={token}>
<SearchLayout
filters={<>
<ValueFilterPanel field="colour" label="Colour" />
<SortByPanel startCollapsed />
</>}
above={<ActiveFiltersPanel />}
results={<SearchResults>{product => <h3>{product.title}</h3>}</SearchResults>} />
</SearchProvider>Coming from InstantSearch
The parts you know, by their names here
instantsearch.js’s widgets and the intrface part for the same job.
| For | instantsearch.js | intrface |
|---|---|---|
| The search field | searchBox | SearchInput typo-tolerant |
| The results | hits, infiniteHits | SearchResults with Load more |
| Results grouped by kind | index, one per kind | SearchSections in one request |
| Numbered pages | pagination | SearchPagination |
| A field’s values, with counts | refinementList | ValueFilterPanel as checkboxes, buttons or a toggle |
| One value at a time | menu | ValueFilterPanel control="radio" |
| A number range | rangeSlider, rangeInput | RangeFilterPanel on a slider or typed |
| A histogram of the values | No widget of its own | RangeFilterPanel showHistogram |
| Bars to click into | No widget of its own | HistogramFilterPanel finer at every click |
| Number brackets | numericMenu | BucketFilterPanel named or of equal width |
| Categories in levels | hierarchicalMenu | HierarchicalFilterPanel |
| Distance from a place | geoSearch | NearFilterPanel Near me or your places |
| The filters on | currentRefinements, clearRefinements | ActiveFiltersPanel |
| The order | sortBy | SortByPanel |
| Filters from the data | No widget of its own | AutoFilters |
| A description to filters | No widget of its own | useFilterSuggestion (Search or ask) |
| The page put together | No widget of its own | SearchLayout in three recipes |
Questions
Before you install it
Do I need an Indx server?
Yes. intrface talks to the Indx server’s HTTP API. The server is source available, under the PolyForm Shield licence, and you run it yourself, on your own machine or in your own Azure subscription.
How do I install it?
npm i @indxsearch/intrface. Version 4 speaks the Indx 2.0 server’s API; npm brings systm, Indx’s design system, with it. It needs React 19.
Can I use it without React?
Yes. @indxsearch/intrface/core holds the search (the text, the filters, the order, the results) with no React and no styles. Subscribe to it from Vue, Svelte or a plain page and render what it holds, with UI SDK’s components or your own.
What does Search or ask need?
The Indx server 6.0, with Search or ask switched on for the dataset in the console, where you also write what the answer agent should know: about the site, about the fields, and anything else. intrface’s components then offer to ask where the dataset allows it.
Can I use my own components?
Yes. Every area of SearchLayout takes your own content, and the bindings (useSearchTextBinding, useFacetBinding, useRangeBinding, useSortBinding, useResultsBinding) connect your own controls to the search.
Do I have to choose the filters myself?
No. AutoFilters builds the filter column from the dataset, or from the panels its owner set in the console: which fields, their names and order, how each is drawn, and whether it shows always or only once it applies to the results. Choose the panels yourself, as on this page, when you want them your way.