SiChatInputComponent documentation¶
si-chat-input 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
actionsinput for buttons, can be used in addition. siChatInputDisclaimerselector: Custom disclaimer content to display below the input area, prefer using thedisclaimerinput for simple text disclaimers.
See - SiAttachmentListComponent for the base attachment component - SiChatInputDisclaimerDirective to slot in custom disclaimer content
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| accept ¶ | string | 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 | 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 | 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 ¶ | { attachments: ChatInputAttachment[], content: string } | 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 | Default | Description |
|---|---|---|---|
| focus() ¶ | () => void | Focus the textarea input |
Types Documentation¶
| | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| 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. |
|---|
| 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 - SiAttachmentListComponent for the attachment list component - SiChatInputComponent for the chat input component - SiChatContainerComponent for the base chat container component where this can be used - SiAiChatComponent for the AI chat container where this needs to be used | ||||||
|---|---|---|---|---|---|---|
|
| | ||||||||
|---|---|---|---|---|---|---|---|---|
|
| 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 - SiUserMessageComponent for the user message - SiChatInputComponent for the chat input component | |||
|---|---|---|---|
|
| | ||||||||
|---|---|---|---|---|---|---|---|---|
|
| | ||||||||
|---|---|---|---|---|---|---|---|---|
|
| Implement and provide this to an SiMenuFactoryComponent to receive trigger events. | |||||||
|---|---|---|---|---|---|---|---|
| |||||||
|
| Parent contract used by SiChatInputComponent when it is projected into a chat container. | |||
|---|---|---|---|
| |||
|
| Chat message type union of all supported message types in the AI chat container. See - UserChatMessage for user messages - AiChatMessage for AI messages - ActivityChatMessage for individual activities - ActivityTraceChatMessage for grouped activities - TemplateChatMessage for template-based messages - BaseChatMessage for the base chat message interface - SiAiChatComponent for the AI chat container where this is used |
|---|
| AI chat message See SiAiChatComponent for the AI chat container where this is used | |||||
|---|---|---|---|---|---|
|
| User chat message for AI chats See SiAiChatComponent for the AI chat container where this is used | ||||||
|---|---|---|---|---|---|---|
|
| Render custom chat message via template, consider using SiChatMessageComponent inside the template for consistent styling See - SiAiChatComponent for the AI chat container where this is used - SiChatMessageComponent for the chat message wrapper component which can be used inside the template | |||
|---|---|---|---|
|
| Definition of a single source | |||||
|---|---|---|---|---|---|
|
| Use this type with filter components colorVariant to render component variants based on background of container |
|---|
| Options for the markdown renderer. This holds all configuration and allows installing extensions. A number of extensions are already ready to use and shipped with Element. Example: | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
|
| | ||
|---|---|---|
|
| |
|---|
| Progress or intermediate activity shown between chat messages. | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Related activities grouped under a shared collapsible heading. The latest trace stays expanded until a user message follows it. | |||||
|---|---|---|---|---|---|
|
| Base interface for all chat messages. Messages can be rendered either with content or with a custom template for advanced styling and functionality. See - ChatMessage for the chat message type union - UserChatMessage for user messages - AiChatMessage for AI messages - TemplateChatMessage for template-based messages | ||||
|---|---|---|---|---|
|
| Reference to a modal dialog | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
| ||||||||||||
| ||||||||||||
|
| |
|---|
| Type handler for a named type. This can be an AST node type, a code type, a directive name | ||||
|---|---|---|---|---|
|
| |
|---|
| Combination of unified plugin with options | |||
|---|---|---|---|
|
| | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| Represents a menu item that navigates using the Angular Router. Requires a configured Angular Router. | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
| | |||
|---|---|---|---|
|
| | |||
|---|---|---|---|
|
| | ||
|---|---|---|
|
| A combination of a component and options passed to it during run-time | |||
|---|---|---|---|
|
| Interface an extension component must implement | ||||
|---|---|---|---|---|
|
| Interface a code highlighter component must implement | |||||
|---|---|---|---|---|---|
|
| Processor import imported from unified |
|---|
| import imported from @types/mdast |
|---|
| Extended root with references |
|---|
| | ||||
|---|---|---|---|---|
|
| Used in events emitted from SiLinkActionService | |||
|---|---|---|---|
|
| |
|---|
| An extension to the si-markdown component | |||||
|---|---|---|---|---|---|
|
| Options passed to makeProcessor() | ||
|---|---|---|
|
| import imported from @types/mdast |
|---|
| import imported from @types/mdast |
|---|
| Plugin import imported from unified |
|---|
| Transformer import imported from unified |
|---|
| Preset import imported from unified |
|---|
| PluggableList import imported from unified |
|---|
| | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |
|---|
| Citation metadata associated with a markdown response. | |||||||
|---|---|---|---|---|---|---|---|
|
| import imported from @types/mdast |
|---|
| Extra node for collecting all footnotes | |||||
|---|---|---|---|---|---|
|
| Container for one or more adjacent citation nodes. | |||||
|---|---|---|---|---|---|
|
| AST node created by remark-directive . | |||||||
|---|---|---|---|---|---|---|---|
|
| import imported from @types/mdast |
|---|
| import imported from @types/mdast |
|---|
| import imported from @types/mdast |
|---|
| import imported from @types/unist |
|---|
| Inline node that references an item in the source citation array. | ||||||
|---|---|---|---|---|---|---|
|
| Attachment list component for displaying file attachments in chat messages. This component renders a list of file attachments with icons, names, and optional preview and remove functionality. It's designed to work with chat message components to show files that have been uploaded or shared in conversations. This component provides: - A list of pills showing each attachment's name and an icon - Optional preview modal for attachments - Optional remove functionality for editable messages The component is included within SiUserMessageComponent , SiAiMessageComponent and SiChatInputComponent but can also be used inside custom chat messages with SiChatMessageComponent See - SiUserMessageComponent for user message display - SiAiMessageComponent for AI message display - SiChatMessageComponent for custom chat message display - SiChatInputComponent for chat input with attachment support - Attachment for attachment data structure | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
| |||||||||||||||||
|
| Directive to mark content as chat input disclaimer into SiChatInputComponent . Apply this directive to content that should be slotted into the disclaimer area. Example: See SiChatInputComponent for the chat input wrapper component | ||
|---|---|---|
|
| User message component for displaying the user's messages in conversational interfaces. The user message component renders user-submitted content in (AI) chat interfaces, supporting text, attachments, and contextual actions. It appears as a text bubble aligned to the right side. Can be used within SiChatContainerComponent . The component automatically handles: - Styling for user messages distinct from AI or generic chat messages - Displaying attachments above the message bubble - Displaying primary and secondary actions See - SiChatMessageComponent for the base message wrapper component - SiAiMessageComponent for the AI message component - SiAttachmentListComponent for the base attachment component - SiChatContainerComponent for the chat container to use this within | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
|
| AI message component for displaying AI-generated responses in conversational interfaces. The AI message component renders AI-generated content in chat interfaces, supporting text, loading states, and contextual actions. It appears as text (no bubble) aligned to the left side without any avatar/icon slot. Can be used within SiChatContainerComponent . The component automatically handles: - Styling for AI messages distinct from user or generic chat messages - Showing loading states with skeleton UI during generation - Displaying primary and secondary actions See - SiChatMessageComponent for the base message wrapper component - SiUserMessageComponent for the user message component - SiChatContainerComponent for the chat container to use this within | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
| Base declarative chat message component that provides the layout structure for chat messages. This component handles the core message layout including avatar positioning, loading states, and action button as well as attachment list placement. It serves as the foundation for more specialized message components like SiUserMessageComponent and SiAiMessageComponent . Can be used within SiChatContainerComponent . The component provides: - Flexible alignment (start/end) for different message types - Avatar/icon slot for message attribution - Loading state with skeleton UI - Action buttons positioned on the side or bottom - Attachment list display slot - Responsive behavior that adapts to container size This is a low-level component designed for slotting in custom content, it provides slots via content projection: - Default content: Main message content area (consider using si-markdown for markdown support) - si-avatar/si-icon/img selector: Avatar or icon representing the message sender - si-chat-message-action selector: Action buttons related to the message - si-attachment-list selector: Attachment list component for displaying file attachmentsSee - SiUserMessageComponent for user message display - SiAiMessageComponent for AI message display - SiAttachmentListComponent for attachment list to slot in - SiChatMessageActionDirective for action buttons to slot in - SiChatContainerComponent for the chat container to use this within | ||||
|---|---|---|---|---|
| ||||
|
| A declarative container component for displaying a chat interface with automatic scroll-to-bottom behavior. This component provides the layout and styling for a chat interface, managing scrolling behavior to keep the newest messages visible while respecting user scrolling actions. It automatically scrolls to the bottom when new content is added, unless the user has scrolled up to view older messages. Use via content projection: - Default content: Chat messages displayed in the scrollable messages container or a welcome screen (empty state). - si-inline-notification selector: Notification component displayed above the input area - si-chat-input or [siChatContainerInput] selector: Input controls for composing messagesSee - SiChatInputComponent for the chat input wrapper component - SiChatContainerInputDirective for other input controls to slot in - SiAiMessageComponent for AI messages to slot in - SiUserMessageComponent for user messages (in AI chats) to slot in - SiChatMessageComponent for the chat message wrapper component to slot in other messages | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
| ||||||||||||
|
| A model-driven chat container component for displaying an AI chat interface with automatic scroll-to-bottom behavior. This component provides an AI chat interface, managing scrolling behavior to keep the newest messages visible while respecting user scrolling actions. It automatically scrolls to the bottom when new content is added, unless the user has scrolled up to view older messages. Required content projection: - si-chat-input : Input controls for composing messagesSee - ChatMessage for the chat message model - AiChatMessage for the AI chat message model - UserChatMessage for the user chat message model - TemplateChatMessage for the template chat message model - SiChatInputComponent for the chat input component - SiChatContainerComponent for the base chat container component - SiAiMessageComponent for the used AI message component - SiUserMessageComponent for the used user message component - SiChatMessageComponent for the base wrapper chat message component used by AI and user message components | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
| | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||
| |||||||||||||||||||||||||
|
| Directive to mark content as chat message actions into SiChatMessageComponent . Apply this directive to e.g. buttons that should be slotted into the message actions area. Example: See SiChatMessageComponent for the chat message wrapper component | ||
|---|---|---|
|
| A directive to mark elements as input controls within a SiChatContainerComponent . This directive is used to identify and style input elements that belong to the chat container component, typically applied to form inputs or textareas used for composing chat messages. Example: See SiChatContainerComponent for the chat container wrapper component | ||
|---|---|---|
|
| Directive for handling file uploads with validation for file type and size. Example: | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||
|
| | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
|
| | |||||||
|---|---|---|---|---|---|---|---|
| |||||||
| |||||||
|
Except where otherwise noted, content on this site is licensed under MIT License.