Search

Search components and flows across the catalog

ThatDesignUIOriginalInteractive preview

AI prompt composer

An auto-growing message box with file attach, a model picker, a web-search toggle and suggestion chips; sending thinks, streams the answer and turns Send into Stop.

Category
AI
Platform
Responsive

Interactive componentClick through it, resize it, or switch states. It’s real UI, not a screenshot.Empty state

Use this component

Free to use. It works on its own in any React and Tailwind project, so you can add it with one command, paste the code, or hand the prompt to your coding agent.

FreeReact 18+Tailwind v3.4 or v4No extra packages

1. Add it with the shadcn CLI

npx shadcn@latest add https://www.thatdesignui.com/r/ai-prompt-composer.json

2. Use it

Every prop is optional
app/page.tsx
import AiPromptComposer from "@/components/ai-prompt-composer";

export default function Page() {
  return <AiPromptComposer />;
}

Prefer to paste it yourself? Open the .

Under the hood

How it’s built

What’s inside

  1. On a #f4f4f6 page with a faint violet glow at the top: a 44rem white composer card (22px radius, soft violet-tinted shadow) with a textarea that grows from 2 to 6 lines.
  2. A toolbar under the text: a paperclip that adds a 'launch-brief.pdf' chip, a model picker menu (Fast / Balanced / Deep think), a 'Search' toggle that turns violet when on, a character count, and a 36px black send button with an up arrow.
  3. Sending shows the question as a black bubble on the right, a 'thinking' row of three bouncing dots, then the answer streaming in word by word with a violet caret; meanwhile the send button becomes a Stop square with a spinning ring.
  4. Three suggestion chips under the composer send their text directly.

How it behaves

  • Enter sends and Shift+Enter adds a new line; the send button is disabled while the box is empty.
  • While answering, Stop (or Escape) ends the stream immediately and Send returns.
  • The model menu opens upward, marks the chosen model with a check and closes on choice or Escape.
  • The attached file chip has a labelled remove button.

More from ThatDesignUI

Image gallery lightbox

Image gallery lightbox

ThatDesignUIOriginalMedia component

Notification center

Notification center

ThatDesignUIOriginalNotifications component

Interactive chart card

Interactive chart card

ThatDesignUIOriginalDashboard component

Multi-select combobox

Multi-select combobox

ThatDesignUIOriginalForms component