Skip to Content
Nextra 4.0 is released 🎉

ChatPrompt

The ChatPrompt component is a pixel-art styled textarea input designed for chat interfaces.
It supports custom sizing, fullwidth mode, placeholder text, and callbacks for text changes and send events — perfect for building retro-styled messaging UIs.


🚀 Usage

Basic Example


import { ChatPrompt } from "pixelartui-react"; <ChatPrompt inputName="chat" onSend={(value) => console.log(value)} />

With Placeholder


<ChatPrompt inputName="chat" placeholder="Type your message..." onSend={(value) => console.log(value)} />

Fullwidth


<ChatPrompt inputName="chat" onSend={(value) => console.log(value)} fullwidth />

Custom Size


<ChatPrompt inputName="chat" onSend={(value) => console.log(value)} width="600px" height="80px" />

Disabled


<ChatPrompt inputName="chat" onSend={(value) => console.log(value)} disabled />

Custom Color


<ChatPrompt inputName="chat" onSend={(value) => console.log(value)} backgroundColor="#b13737" />

Styles


<ChatPrompt inputName="chat" onSend={(value) => console.log(value)} chatPromptStyle="dark" /> <ChatPrompt inputName="chat" onSend={(value) => console.log(value)} chatPromptStyle="light" />

🔧 Props

PropTypeDefaultDescription
inputNamestringName attribute for the textarea input.
placeholderstringundefinedPlaceholder text displayed when the input is empty.
backgroundColorstringundefinedOverrides the default background color with a custom value.
disabledbooleanfalseDisables interaction with the component.
valuestringundefinedControlled value of the textarea.
classNamestringundefinedAdds additional CSS classes for custom styling.
chatPromptStyle"dark" | "light"undefinedApplies a light or dark theme to the component.
widthstringundefinedSets a custom width (e.g., "600px").
heightstringundefinedSets a custom height (e.g., "80px").
fullwidthbooleanfalseMakes the component expand to fill the width of its container.
onChange(e: React.ChangeEvent<HTMLTextAreaElement>) => voidundefinedCallback fired when the textarea value changes.
onSend(value: string) => voidundefinedCallback fired when the send action is triggered.
Last updated on