Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Seek Search, animated React component

  • Pro
  • Inputs & Controls
  • Spring

Taps when you pick a suggestion. Sound is off on this site until you switch it on. Types with a key click for every character, in sync with the text. The click stays off until you switch it on.

Props

PropTypeDefaultWhat it does
suggestions["Quarterly report", "Design review notes", …]Local suggestions shown under the field and filtered as you type. Nothing is fetched.
placeholder"Search files"Placeholder and accessible name of the field.
maxLength64Longest query the field accepts; the query is trimmed before filtering.
onSelectundefinedCalled with a suggestion when it is clicked.
autoplayfalseOpens, types a word, clears and folds back on a loop until the user interacts.
enableSoundtruePlays interface sounds on interaction. They follow the sound switch (setSoundsEnabled, on by default) and stay silent on hover. Autoplay makes the same sounds once the visitor has used the page. Pass false to silence this component.

Add it to your project

  1. 1

    Set up your project once

    You need a Next.js project with Tailwind CSS and the @/ import alias. In its root folder, run this once. It creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry with your API key

    Seek Search is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and add this entry inside the outermost braces, next to "aliases". Leave {name} and ${NEXUS_API_KEY} exactly as written; the CLI fills them in:
      "registries": {
        "@nexus-labs": {
          "url": "https://www.nexus-ui.com/api/registry/{name}",
          "headers": {
            "Authorization": "Bearer ${NEXUS_API_KEY}"
          }
        }
      }

How Seek Search works

Search that opens as one object. The magnifier slides from the middle of suggestions drop in underneath and filter as you type. Escape, or clicking away when it's empty, folds it back.

The source, the install command and the build prompt come with Pro.

Seek Search questions

How do I install Seek Search?

Run `npx shadcn@latest add @nexus-labs/seek-search`. It installs framer-motion. Seek Search is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).

How do I set the suggestions and react to a click?

Pass `suggestions` as an array of strings. They are filtered in the browser as the user types (case-insensitive match, with the matched text in bold) and nothing is fetched. `onSelect` receives the suggestion that was clicked.

How do I close it from the keyboard?

Press Escape to fold it back and clear the query. Clicking away also folds it, but only when the field is empty; with text in it, it stays open. The closed button has `aria-expanded` set.

Which props change the field itself?

`placeholder` (default "Search files") is also the field's accessible name, and `maxLength` (default 64) caps how many characters the query can hold. The pill is 300px wide when open.

Does it make sound, and how do I turn it off?

Taps when you pick a suggestion. Sounds are synthesised with the Web Audio API, so there are no audio files, and they only play after a click or key press. Pass `enableSound={false}` to silence this component, or call `setSoundsEnabled(false)` from `@/lib/ui-sounds` to switch every sound off at once. The CLI installs `@/lib/ui-sounds` with the component.

Guides