Articles

Update ·

Build your search with UI SDK

intrface is built on UI SDK, and npm installs the two together. Three recipes to copy: search with Cmd+K, a filter for thousands of values, and filters in a drawer.

UI SDK is a new open source library of interface behaviours: dialogs, menus, comboboxes, drawers, with the keyboard, the focus and the screen reader support worked out, and the look left to you. Agents can build with it, and operate what's built.

It has no search engine, and it shouldn't. That part is ours. intrface, the search UI for Indx, is built on UI SDK, so the two already fit together.

UI SDK brings the behaviour. Indx brings the results.

One install

npm install @indxsearch/intrface

npm installs UI SDK beside it. Start with intrface's own components: the search field, the results, the filter panels and Search or ask take your page's look and are ready to use. When you want something they don't cover, use a UI SDK component and connect it with one of intrface's hooks.

Three recipes to copy

Each is one file, with one stylesheet for all three that follows your page's font and colours, and a shadcn theme where there is one.

  • Search with Cmd+K. UI SDK's Command in a Dialog, opened from anywhere on your site. Indx finds and ranks, typos included, and a pick is counted in your statistics.
  • A filter with thousands of values. UI SDK's Combobox over a field such as people, brands or authors. The values are asked for as they're typed, each with its count in the visitor's search.
  • Filters in a drawer. UI SDK's Drawer around the filter panels you already have, for a phone. Its button says how many results the filters leave.

A page agents can operate

UI SDK comes with a bridge that lets an AI agent read a page and use it. Wrap your search in intrface's SearchAgent, and an agent can search, filter and sort on it, with your rules on what it may do. Its searches can be counted apart from people's.

Good to know

UI SDK is in beta, so its API may still change. Since 4.0.1, intrface takes any 0.1 version of it from beta.17 on, so you can follow its releases. The how-to shows how each recipe is connected, and you need an Indx server: it's source available, and you run it yourself.

Keep reading

More articles