SiUserMessageComponent documentation¶
si-user-messageUser 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 and supports markdown formatting for rich content. Can be used within SiChatContainerComponent .
The component automatically handles: - Styling for user messages distinct from AI or generic chat messages - Option to render markdown content, provide via contentFormatter input with a markdown renderer function (e.g., from getMarkdownRenderer ) - 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 - getMarkdownRenderer for markdown formatting support - SiChatContainerComponent for the chat container to use this within
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| actionParam ¶ | any | Parameter to pass to action handlers | |
| actions ¶ | MessageAction[] | [] | Primary message actions (edit, delete, copy, etc.). All actions displayed inline |
| attachments ¶ | Attachment[] | [] | List of attachments included with this message |
| content ¶ | string | '' | The user message content |
| contentFormatter ¶ | (text: string) => (string | Node) | undefined | Optional formatter function to transform content before display. - Returns string: Content will be inserted as text with built-in sanitization - Returns Node: DOM node will be inserted directly without sanitization Note: When returning a Node with formatted content, apply the markdown-content class to the root element to ensure proper styling (e.g., div.className = 'markdown-content' ). The function returned by getMarkdownRenderer does this automatically.Warning: When returning a Node, ensure the content is safe to prevent XSS attacks |
| secondaryActions ¶ | MenuItem[] | [] | Secondary actions available in dropdown menu, first use primary actions and only add secondary actions additionally |
| secondaryActionsLabel ¶ | TranslatableString | $localize`:@@SI_USER_MESSAGE.SECONDARY_ACTIONS:More actions` | More actions button aria label |
Types Documentation¶
Function Returns a markdown renderer function which_ - Transforms markdown text into formatted HTML. - Returns a DOM node containing the formatted content. Warning: The returned Node is inserted without additional sanitization. Input content is sanitized before processing. @param: Angular DomSanitizer instance Returns A function taking the markdown text to transform and returning a DOM div element containing the formatted HTML | ||
|---|---|---|
|
| Actions for messages representing an action with icon, label (for accessibility), and handler, for use within SiAiMessageComponent and SiUserMessageComponent . Only the icon will be displayed. See - SiAiMessageComponent for the AI message - SiUserMessageComponent for thee user message | |||||
|---|---|---|---|---|---|
|
| 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 | |||
|---|---|---|---|
|
| 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. |
|---|
|
|
| Represents a menu item that navigates using the Angular Router. Requires a configured Angular Router. | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
Translatable import imported from @siemens/element-translate-ng |
|---|
|
| 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 chat container component | ||||||
|---|---|---|---|---|---|---|
|
|
| Implement and provide this to an SiMenuFactoryComponent to receive trigger events. | |||||||
|---|---|---|---|---|---|---|---|
| |||||||
|
|
| Reference to a modal dialog | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
| ||||||||||||
| ||||||||||||
|
|
|
| Used in events emitted from SiLinkActionService | |||
|---|---|---|---|
|
|
| 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 something like an 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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
| ||||||||||
|
| 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 SiMarkdownRendererComponent 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 - SiMarkdownRendererComponent for markdown content rendering - 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 formatting, markdown, 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 - Option to render markdown content, provide via contentFormatter input with a markdown renderer function (e.g., from getMarkdownRenderer ) - Showing loading states with skeleton UI during generation - Displaying primary and secondary actionsSee - SiChatMessageComponent for the base message wrapper component - SiUserMessageComponent for the user message component - getMarkdownRenderer for markdown formatting support - SiChatContainerComponent for the chat container to use this within | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
| 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 | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
| |||||||||||||||||
|
| 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 - SiChatInputDisclaimerDirective to slot in custom disclaimer content | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||
|
| 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 | ||
|---|---|---|
|
| Component to display markdown text, uses the getMarkdownRenderer function internally, relies on markdown-content theme class. | |||||
|---|---|---|---|---|---|
| |||||
|
| 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 | ||
|---|---|---|
|
| 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 | ||
|---|---|---|
|
| |||||||||||||||||||||||||
| |||||||||||||||||||||||||
|
| |||||||||||||||||||||
| |||||||||||||||||||||
|
| |||||||
| |||||||
|
Except where otherwise noted, content on this site is licensed under MIT License.