Skip to content
Knowns UI
Get ProSign in

Typed Search Demo

Shows what a search finds by searching: sample queries type themselves in turn and the results change with each one. Focus the field and it becomes a real search over every sample result.

On this page

Examples

Results

Installation

npx knowns-ui@latest add typed-search-demo
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

queries
{ query, results }[]
Sample queries in the order they are typed, each with what it finds. The first is on show from the first render.
renderResult
(item, index) => ReactNode
Defaultrow
Draws one result. The default row has an icon, a title and a meta line.
resultText / resultKey
(item) => string
Defaulttitle + meta / id
What a typed query matches (every word, as a word start) and a stable key per result.
label / placeholder
string
Default"Search"
The field's accessible name, and its placeholder once cleared.
hold
number
Default1800
Ms a typed query holds before it is deleted.
empty
ReactNode
Shown when a typed query finds nothing.
onQueryChange
(query, "sample" | "typed") => void
Each query on show, so a later section can carry it on.
paused
boolean
Defaultfalse
Hold the demo on the current query.
trailing
ReactNode
Something at the end of the field, such as a shortcut hint.
resultsClassName
string
Layout of the results: a column of rows by default, or a grid.

States

First render
The first query typed, its results shown
nothing plays
A query lands
Its results rise in, row by row from the first
Default180ms each, 40ms apart
ease out
Deleting
The last results stay
-
Focus or Pause
The demo stops; typing filters every sample result
Defaultat once
-
Off screen, hidden tab
Holds
-
Reduced motion
The first query and its results, still
-

Accessibility

  • A real search field with a label. While the demo runs, it is described as sample searches that stop on focus.
  • A visible Pause button while it types (motion over five seconds needs a way to stop it).
  • Results are announced politely only once the visitor types, so the demo does not talk over the page.

When to use

When to use

  • A landing section that shows what a search finds by searching: sample queries type in turn and the results change.
  • A hero whose search a visitor can take over, with the query carried into later sections through onQueryChange.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Typed Search Demo to my app and wire it to my own data.
  • I need a landing section that shows what a search finds by searching: sample queries type in turn and the results change. Set that up with the Knowns UI Typed Search Demo.
  • Which Typed Search Demo props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "typed-search-demo" }) and search_docs({ query: "typed search demo" }).

Need help?

Stuck on Typed Search Demo, or found something off? We read every message.