Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Forge AI Command Bar, animated React component

A command bar for an AI copilot: pick Ask, Edit or Build, type a prompt or tap a suggestion and send it. The bar grows a panel where the prompt lands as a heading and each step ticks off while a light runs round the edge; Cmd/Ctrl+K focuses it and Esc stops a run.

  • Pro
  • AI Components
  • Spring

Whooshes on send, ticks when you switch mode and 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.

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Type a prompt or tap a suggestion. Esc stops it.

Props

PropTypeDefaultWhat it does
placeholder"Describe what you need..."Placeholder while the field is empty.
suggestions3 promptsOne-tap prompts shown under the field while it is empty (up to three).
defaultMode"build"Mode the switcher starts on.
onSubmit—Called with the prompt and mode when the user sends it.
steps—Builds the progress steps shown while the copilot works. Defaults to four generic steps.
hotkey"k"Key that focuses the bar with Cmd or Ctrl. Empty string turns the shortcut off.
autoplayfalseTypes and runs the suggestions in turn until someone touches the bar.
className—Extra classes for the root.
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

    Forge AI Command Bar 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 Forge AI Command Bar works

A command bar for an AI copilot. Pick Ask, Edit or Build, type or tap a suggestion and send: the bar grows a panel above the field where the prompt lands as a heading and each step ticks off in turn, while a light runs round the edge. Cmd/Ctrl+K focuses it, Esc stops a run.

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

About Forge AI Command Bar

The Forge AI Command Bar is an animated command surface for AI copilots and chat interfaces. The input bar expands with a Framer Motion spring layout animation when focused, revealing context chips and suggested commands below the text field. Streaming response text enters with a character-by-character animation. Designed to demo AI product features and copilot interfaces, it integrates with any streaming chat API including the Vercel AI SDK.

Good for

  • AI copilot and chat product demos
  • Natural language command interfaces
  • AI search and query surfaces
  • Developer tool AI feature showcases

Forge AI Command Bar questions

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

Whooshes on send, ticks when you switch mode and 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.