Skip to content
Edit this page

SiChatInputComponent documentation

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 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

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

Name Type Description
focus()
() => void

Focus the textarea input

Types Documentation

import type { ChatInputAttachment } from '@siemens/element-ng/chat-messages';

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

import type { MenuItemAction } from '@siemens/element-ng/menu';
Properties

import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';

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.

import type { FileUploadError } from '@siemens/element-ng/file-uploader';
Properties

import type { MenuItemBase } from '@siemens/element-ng/menu';
Properties

import type { Attachment } from '@siemens/element-ng/chat-messages';

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

import type { UploadFile } from '@siemens/element-ng/file-uploader';
Properties


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