Skip to content

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

chat input example

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

Chat input elements

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

Interaction states

Chat input 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.

Chat input actions

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.

Chat input attachments

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)"
/>

SiChatInputComponent API Documentation

Source
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

NameTypeDefaultDescription
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 siChatInputDisclaimer directive. If both are empty, no disclaimer section will be shown (handled via CSS :empty).

followUpPrompts
string[] []

Suggested follow-up prompts to display as pill buttons above the chat input. Use followUpPromptSelected to handle selection and update the input value. Typically populated from AI response data and cleared after selection or on send.

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 {{attachment}}.

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

NameTypeDescription
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

NameTypeDescription
focus()
() => void

Focus the textarea input

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

Properties
Properties

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.

Properties
Properties

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

Properties
Properties

Except where otherwise noted, content on this site is licensed under MIT License.