UI components · Form input
Chat Input
Also called: Composer, Prompt input, Message input, Chat box
The input area at the bottom of a chat or AI conversation. A text box that grows with its content, plus buttons for attachments and sending (Send turns into Stop while generating). Enter sends, Shift+Enter adds a new line.
Click “Labeled” to see what each part is called.
How to tell AI
Swap in your own content firstAdd a chat input at the bottom of the AI chat page. The container is centered with a max width of 760px, a white background, a 1px light gray border, 24px corner radius, and a soft shadow. Inside is an auto-growing text box, 1 line by default and up to 6 lines before it scrolls inside, with the placeholder "Message AI Assistant." In the bottom left, put two 32px icon buttons, "Attach" and "Web search." In the bottom right, put a 36px round send button that's grayed out when the box is empty and turns into a square "Stop" button while the AI is replying. Show uploaded files as 48px-tall cards above the text box, each with an ✕ in the top right corner. Enter sends and Shift+Enter adds a new line, and pressing Enter while an IME is composing must not send. Below the input, center a line of 12px gray text: "AI can make mistakes. Check important info." On phones, move it up with the on-screen keyboard.
Send to
01Decide
Does your content look like this?
Check both columns to confirm Chat Input is what you need.
Use Chat Input when
- Sending messages to AI in an assistant, a support bot, or a Copilot sidebar
- The message input for instant messaging, direct messages, and group chats
- When a message needs images or files attached, or a model picked before sending
Pick something else when
Posting a comment under an article or product. Use the comment section's own box, where you click "Post" and you're done.
Use insteadCommentContent with several fields (title, category, body)
Use insteadFormWriting long articles that need formatting
Use insteadRich Text Editor
Not sure? Upload a screenshot and page analysis will check which layout each block should use.
02Pitfalls
Common misuse
It looks like it works, but it makes things harder for users.
- 01
Pressing Enter to pick a character in an IME sends half a sentence
- 02
The input stays one line tall, so long questions can only be read by scrolling sideways
- 03
The send button doesn't change while the AI replies, so there's no way to stop it and no sign that it's generating
03Spot it
How to spot it
Look at the overall structure first, then check a few features you can spot at a glance.
Structure
One rounded container holding an auto-growing textarea, attachment preview cards, tool buttons on the left (attach, model, web search), and a send / stop button on the right, usually with a line of hint text below.
PartsClick one to highlight it in the wireframe above
04Explained
In detail
The chat input is pinned to the bottom of the conversation, and it's where users talk. At its core is a Textarea that starts one line tall, grows as you type, and switches to scrolling inside after five or six lines. A row of small buttons in the bottom left holds tools like "Attach file," "Choose model," and "Web search." On the right is a round send button that's grayed out when there's no text and turns into a square "Stop" while the AI is replying. Uploaded images and files show up as small cards above the text box, each removable on its own. A line of small gray text often sits below, like "AI can make mistakes. Check important info."
What sets it apart from a plain Textarea is that it's a bundle. The text box, tool buttons, attachment previews, and send button live in one rounded container, along with chat-specific behavior like Enter to send and Stop while generating. It's also different from a Comment box. A comment box sits under the content, and you click "Post" once and you're done. A chat input stays at the bottom of the screen, clears right after sending, and waits for the next message.
Enter to send and Shift+Enter for a new line is the standard, but pressing Enter to pick a character in a Chinese or Japanese input method (IME) must not send the message, so check whether the IME is still composing. After sending, clear the box and keep focus in it. If sending fails, put the text back so users don't have to retype it. On phones, the input should move up with the on-screen keyboard instead of getting hidden behind it. Give the input an aria-label, and give an icon-only send button a name too.
Developer infoTerm ID, DOM cues, match priority
- Term ID
component-chat-input- DOM selectors
The extension matches these CSS selectors when it inspects a page locally (tags, ARIA roles, common component library classes).
.ant-sender.cs-message-input.rce-input.str-chat__message-input:is(div, form):has(> textarea):has(> button:is([aria-label*="发送"], [aria-label*="send" i]))
- Class keywords
Class names, ids and data-testid are split into words and matched in order, so page-header, PageHeader_root__x7a and pageHeader all become page, header.
chat-inputchat-composercomposermessage-inputmessage-composermsg-inputprompt-inputprompt-boxprompt-barchat-form
- Component names
React / Vue component names read in development mode. Case-insensitive; library prefixes such as El, Ant and Mui are dropped.
ChatInputChatComposerComposerMessageInputMessageComposerPromptInputChatSender
- Structure
Computed from how the element is laid out and styled. It only adds to the score and never decides on its own.
form controls
- Priority
- 3 · when several match at the same level, the higher priority wins
- Version
- v2 · updated Sep 30, 2026