AI Components/PromptEditor

PromptEditor

A textarea for writing AI prompts. Auto-resizes as you type, shows a character counter, and submits on Cmd+Enter — perfect for system prompt builders and playground UIs.

import { PromptEditor } from "@animui/ui"

Basic

0 / 4000

Character limit

The counter turns amber at 80% capacity and red when you exceed the limit.

0 / 200

Loading state

0 / 4000

Click Send to simulate a 2-second request

Props

PropTypeDefaultDescription
valuestring""Controlled value of the textarea.
onChange(value: string) => voidCalled on every keystroke with the current value.
onSubmit(value: string) => voidCalled with the final prompt value when Cmd+Enter / Ctrl+Enter is pressed or Send is clicked.
placeholderstring"Enter your prompt…"Placeholder text shown when editor is empty.
maxLengthnumber4000Character limit. Shows a live counter that turns amber near the limit and red when exceeded.
disabledbooleanfalseDisables the textarea and Send button.
loadingbooleanfalseReplaces Send button label with a spinner while a request is in-flight.
classNamestringAdditional classes for the outer wrapper.
© 2026 Steal Shadow. MIT License.Report an issue