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

PropTypeDefaultRequiredDescription
valuestringNoControlled value of the textarea.
onChange(e: React.ChangeEvent<HTMLTextAreaElement>) => voidNoFired when the textarea value changes.
onSubmit() => voidNoFired when the submit button is clicked.
onStop() => voidNoFired when the stop button is clicked during generation.
onAttach() => voidNoFired when the attach action is clicked. Hides the attach button when omitted.
onOptimize() => voidNoFired when the optimize action is clicked. Hides the optimize button when omitted.
attachmentsReact.ReactNodeNoRender-prop slot for attachment chips above the textarea.
isGeneratingbooleanNoWhen true, the submit button becomes a stop button.
isOptimizingbooleanNoWhen true, shows a loading spinner on the optimize button.
placeholderstringNoPlaceholder text for the textarea.
showAttachbooleantrueNoWhether the attach button is rendered.
showMicbooleantrueNoWhether the mic button is rendered.
variant"default""default"NoVisual variant.
size"default" | "sm""default"NoSize scale.
Last updated: August 5, 2026 at 11:47 AMEdit this page