Chat input¶
The chat input is a text field for composing and submitting messages in conversational interfaces. It supports both AI-assisted interactions and human-to-human chat.
Usage¶
The chat input enables users to send messages or comments depending on context:
- User chat: Sends real-time messages in a conversation
- AI chat: Submits queries to a system for response
- Commenting: Adds contextual feedback or notes tied to a specific element

When to use¶
- In any interface where users need to communicate or leave feedback.
- When freeform text input is required in chat, messaging, or commenting scenarios.
Best practices¶
- Always autofocus the input prompt when the page or chat view is opened.
- Limit input width to 720px for legibility.
- Match placeholder text to context (e.g., “Ask anything”, “Type a message”, “Leave a comment”).
- Disable the send button when input is empty or invalid.
- Add the legal disclaimer when used for AI functions.
Design¶
Elements¶

- Placeholder text, 2. Container, 3. Send button, 4. Actions (optional), 5. Legal disclaimer (only for conversational AI)
Interaction states¶

Actions¶
When actions are available, they appear directly below the text area It is recommended to display up to one action inline; any additional actions should be grouped into a menu.

Attachments¶
When supported, attachments appear within the input area as part of the composed message, allowing users to review and remove them before sending.
If multiple attachments are added, they wrap and stack within the input field.

Overflow behavior¶
The input field automatically expands as the user types, up to a set maximum height. Beyond that point, scrolling is enabled within the input.
Follow-up prompts¶
Follow-up prompts are suggested next actions displayed as pill buttons above the chat input after an AI response. They help users continue the conversation without having to formulate the next message from scratch.
- Prompts wrap to multiple lines when labels are long.
- Selecting a prompt inserts its text into the input field so the user can review or edit before sending.
- The prompt list is cleared when the user sends a message.
Code¶
Follow-up prompts¶
Pass a string[] to followUpPrompts to display suggested prompts above the input. When the user clicks a prompt, followUpPromptSelected emits its text. Use the event to insert the text into the input and clear the prompt list. Clear the list (set to []) on send and repopulate it after each AI response.
<si-chat-input
[followUpPrompts]="aiResponse?.followUpPrompts ?? []"
(followUpPromptSelected)="onFollowUpSelected($event)"
(send)="onSend($event)"
/>
import { SiChatInputComponent } from '@siemens/element-ng/chat-messages'; Chat input component for composing and sending messages in conversational interfaces.
The chat input component provides a text area for users to compose messages, supporting text, attachments, and contextual actions. It appears as a textarea with buttons for adding attachments and sending messages, as well as an optional disclaimer.
The component automatically handles:
• Styling for chat input and actions.
• Dynamic resizing of the textarea based on content.
• Uploading of and displaying of attachments above the input area.
• Displaying primary and secondary actions.
Additionally to the inputs and outputs documented here, the component supports content projection via the following slots:
• Default content: Custom action buttons to display inline, prefer using the actions input for buttons, can be used in addition.
• siChatInputDisclaimer selector: Custom disclaimer content to display below the input area, prefer using the disclaimer input for simple text disclaimers.
See: SiAttachmentListComponent for the base attachment component
See: SiChatInputDisclaimerDirective to slot in custom disclaimer content
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| accept ¶ | string | undefined | undefined | Accepted file types for attachments (as accept string) |
| actionParam ¶ | any | Parameter to pass to action handlers | |
| actions ¶ | MenuItemAction[] | [] | Primary actions available in the input. Provide at most one action. |
| allowAttachments ¶ | boolean | false | Whether file attachments are supported |
| attachFileLabel ¶ | TranslatableString | $localize`:@@SI_CHAT_INPUT.ATTACH_FILE:Attach file` | Attach file button aria label |
| attachments ¶ | ChatInputAttachment[] | [] | Current attachments |
| autoFocus ¶ | boolean | false | Auto-focus the input on component initialization |
| disabled ¶ | boolean | false | Whether the input is disabled |
| disclaimer ¶ | TranslatableString | undefined | A disclaimer to display. If not provided, the component will look for projected content with the | |
| followUpPrompts ¶ | string[] | [] | Suggested follow-up prompts to display as pill buttons above the chat input. Use |
| interruptButtonLabel ¶ | TranslatableString | $localize`:@@SI_CHAT_INPUT.INTERRUPT:Stop processing` | Interrupt button label |
| interruptible ¶ | boolean | false | Whether the input supports interrupting ongoing operations. When active, the send button transforms into an interrupt button (with element-stop-filled icon). If sending is true, the interrupt button will be disabled. |
| label ¶ | string | t(() => $localize`:@@SI_CHAT_INPUT.LABEL:Chat input`) | The label for the input, used for accessibility |
| maxFileSize ¶ | number | 10485760 (10MB) | Maximum file size in bytes |
| maxLength ¶ | number | undefined | Maximum number of characters allowed | |
| placeholder ¶ | TranslatableString | $localize`:@@SI_CHAT_INPUT.PLACEHOLDER:Enter a message…` | Placeholder text for the input |
| removeAttachmentLabel ¶ | TranslatableString | $localize`:@@SI_ATTACHMENT_LIST.REMOVE_ATTACHMENT:Remove {{attachment}}` | Remove attachment aria label. The attachment name is available with |
| secondaryActions ¶ | MenuItemAction[] | [] | Secondary actions available in dropdown menu |
| secondaryActionsLabel ¶ | TranslatableString | $localize`:@@SI_CHAT_INPUT.SECONDARY_ACTIONS:Additional actions` | More actions button aria label |
| sendButtonIcon ¶ | string | this.icons.elementSendFilled | Send button icon |
| sendButtonLabel ¶ | TranslatableString | $localize`:@@SI_CHAT_INPUT.SEND:Send` | Send button label |
| sending ¶ | boolean | false | Whether a message is currently being sent, also prevent the sending of new ones while still allowing the user to type |
| value ¶ | string | '' | Current input value |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| attachmentsChange ¶ | ChatInputAttachment[] | Current attachments |
| fileError ¶ | FileUploadError | Emitted when file upload errors occur |
| followUpPromptSelected ¶ | string | Emitted when the user selects a follow-up prompt. The emitted value is the text of the selected prompt. |
| interrupt ¶ | void | Emitted when the user wants to interrupt the current operation |
| interruptibleChange ¶ | boolean | Whether the input supports interrupting ongoing operations. When active, the send button transforms into an interrupt button (with element-stop-filled icon). If sending is true, the interrupt button will be disabled. |
| send ¶ | { content: string; attachments: ChatInputAttachment[]; } | Emitted when the user wants to send a message |
| sendingChange ¶ | boolean | Whether a message is currently being sent, also prevent the sending of new ones while still allowing the user to type |
| valueChange ¶ | string | Current input value |
Attributes and Methods¶
Types Documentation¶
Attachment item interface for file attachments in chat messages, extension of Attachment for SiAttachmentListComponent to use within SiChatInputComponent. Adds the action file information. Can be used within SiChatContainerComponent. See: Attachment for base attachment interface See: SiAttachmentListComponent for the attachment list component See: SiChatInputComponent for the chat input component See: SiChatContainerComponent for the base chat container component where this can be used See: SiAiChatComponent for the AI chat container where this needs to be used File object File name name : Optionally show a preview of the attachment by providing a template that is shown in a modal when clicked (optional) previewTemplate ? : File size in bytes MIME type
string Inherited from Attachment ¶ TemplateRef<any> | (() => TemplateRef<any>) Inherited from Attachment ¶
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService. action : Badge that is rendered after the label. badge ? : Color of the badge (not iconBadge). badgeColor ? : Whether the menu item id disabled. disabled ? : Optional icon that will be rendered before the label. icon ? : Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. iconBadge ? : ID that will be attached to the DOM node. id ? : Label that is shown to the user. label :
string | ((actionParam: any, source: MenuItemAction) => void) ¶ string | number Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ string | number | boolean Inherited from MenuItemBase ¶ string Inherited from MenuItemBase ¶ TranslatableString Inherited from MenuItemBase ¶
Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.
errorParams ? : errorText : file : fileName : progress : size : status :
Record<string, unknown> Inherited from UploadFile ¶ TranslatableString Inherited from UploadFile ¶ File Inherited from UploadFile ¶ string Inherited from UploadFile ¶ number Inherited from UploadFile ¶ string Inherited from UploadFile ¶ "invalid" Inherited from UploadFile ¶
Badge that is rendered after the label. Color of the badge (not iconBadge). badgeColor ? : Whether the menu item id disabled. Optional icon that will be rendered before the label. Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. ID that will be attached to the DOM node. Label that is shown to the user.
string ¶
Attachment item interface for file attachments in chat messages, used by SiAttachmentListComponent and inside SiUserMessageComponent as well as SiChatInputComponent. See: SiAttachmentListComponent for the attachment list component See: SiUserMessageComponent for the user message See: SiChatInputComponent for the chat input component File name Optionally show a preview of the attachment by providing a template that is shown in a modal when clicked (optional) previewTemplate ? :
TemplateRef<any> | (() => TemplateRef<any>) ¶
Except where otherwise noted, content on this site is licensed under MIT License.