AI Prompt Input
Prompt input surface for AI-assisted workflows with attach, optimize, and submit actions.
Import/Installation
import { AIPromptInput } from "@lottiefiles/creator-plugins-ui";Preview
Usage
<AIPromptInput value={prompt} onChange={(e) => setPrompt(e.target.value)} onSubmit={handleGenerate} />Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| value | string | — | No | Controlled value of the textarea. |
| onChange | (e: React.ChangeEvent<HTMLTextAreaElement>) => void | — | No | Fired when the textarea value changes. |
| onSubmit | () => void | — | No | Fired when the submit button is clicked. |
| onStop | () => void | — | No | Fired when the stop button is clicked during generation. |
| onAttach | () => void | — | No | Fired when the attach action is clicked. Hides the attach button when omitted. |
| onOptimize | () => void | — | No | Fired when the optimize action is clicked. Hides the optimize button when omitted. |
| attachments | React.ReactNode | — | No | Render-prop slot for attachment chips above the textarea. |
| isGenerating | boolean | — | No | When true, the submit button becomes a stop button. |
| isOptimizing | boolean | — | No | When true, shows a loading spinner on the optimize button. |
| placeholder | string | — | No | Placeholder text for the textarea. |
| showAttach | boolean | true | No | Whether the attach button is rendered. |
| showMic | boolean | true | No | Whether the mic button is rendered. |
| variant | "default" | "default" | No | Visual variant. |
| size | "default" | "sm" | "default" | No | Size scale. |
Last updated: August 5, 2026 at 11:47 AMEdit this page