AI chat¶
The AI chat provides a complete AI chat interface that enables users to interact with AI-powered features through conversation.
Usage¶
The AI chat enables users to interact with a product by submitting requests, asking questions, and receiving responses in natural language.
It uses the chat container with AI-specific behavior, such as follow-up prompts and the activity message for tool calls.

When to use¶
- For AI features where users describe tasks in their own words and expect structured responses or guidance.
- When natural language input improves the experience compared to navigating multiple UI elements.
Best practices¶
- Always allow users to review, edit, or retry.
- Use the AI welcome screen when starting a new conversation to introduce the assistant and help users understand how to interact with it.
- Use follow-up prompts after AI responses to help users continue the conversation without formulating the next message from scratch.
- Refer to AI chat history pattern for guidelines on displaying and managing previous AI conversations
- Refer to conversational design guidelines.
Design¶
Elements¶

Layout patterns¶
Full page layout¶
Use it when AI is the main feature. Typically triggered from a dedicated navigation item, this layout makes AI functionality easily accessible as a primary experience.

Side panel layout¶
Use it when AI supports tasks within the current view. In this case, the AI appears as an on-demand assistant without disrupting the workflow in a side panel.
- When the AI feature is globally accessible, the side panel can be triggered from the application header, ensuring consistent entry across all screens.
- For contextual use, place the trigger near the related feature or content.

Errors and AI limitations¶
System errors, such as timeouts or backend crashes, occur outside the AI’s reasoning. These should be represented with inline notifications, placed above the input prompt.
When the AI cannot complete a task due to a known limitation, it should respond within the conversation. These are not treated as errors and do not require a separate notification.

Follow-up prompts¶
Follow-up prompts are 2-4 suggested actions based on the AI’s last response. They guide users toward deeper or related questions.
Show follow-up prompts only after relevant AI responses, and clear them as soon as the user sends a new message.

- Follow-up prompts
Code¶
si-ai-chat is model-driven: pass message data through the messages input, and the component renders the conversation for you. It supports streaming responses, message actions, and activity traces.
Place si-ai-chat in a layout with a fixed height, or set the component's height in pixels if the layout does not provide one.
Welcome screen¶
By default, the built-in AI welcome screen appears when there are no messages and loading is false.
The example starts with a conversation. Use Clear messages in the chat input to see the welcome screen.
Set [hideWelcomeScreen]="true" to disable the welcome screen.
<si-ai-chat [messages]="messages()" [hideWelcomeScreen]="true">
<si-chat-input (send)="onMessageSent($event)" />
</si-ai-chat>
Activity messages and traces¶
Use type: 'activity' for an individual step, such as a tool call or a progress update. Use type: 'activity-trace' to group related steps under one collapsible heading. For design guidance, see Activity message.
Choose what to display¶
Use content for a single Markdown description. Use input and output when the activity needs to distinguish what went into a step from what it returned. input accepts a string, an array of short labels, or a record that maps labels to text. output accepts a string.
The si-ai-chat component's show input controls which input and output details are visible. It does not affect content.
auto(default): Show the output if it is non-blank; otherwise, show the inputs.inputs: Show only the inputs, if provided.outputs: Show only the output, if non-blank.both: Show inputs and non-blank output, when present.
Control automatic expansion¶
By default, the latest activity or trace opens automatically. A newer activity, trace, or user message ends that automatic expansion; an AI response alone does not.
- Set
[autoExpand]="false"onsi-ai-chatto turn off automatic expansion by default. - Set
autoExpandon a trace, activity, or nested activity to override the inherited setting. - Use
autoExpandInputsandautoExpandOutputsto control expansion of individual details. For labeled inputs, pass an array of record keys toautoExpandInputsto expand only those inputs.
Setting [autoExpand]="false" changes the default, not the overrides. For example, if the latest activity has visible output, autoExpandOutputs: true can still expand it automatically.
import { SiAiChatComponent } from '@siemens/element-ng/chat-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 messages
See: ChatMessage for the chat message model
See: AiChatMessage for the AI chat message model
See: UserChatMessage for the user chat message model
See: TemplateChatMessage for the template chat message model
See: SiChatInputComponent for the chat input component
See: SiChatContainerComponent for the base chat container component
See: SiAiMessageComponent for the used AI message component
See: SiUserMessageComponent for the used user message component
See: SiChatMessageComponent for the base wrapper chat message component used by AI and user message components
Input Properties¶
| Name | Type | Default | Description |
|---|---|---|---|
| activityInputArgumentsLabel ¶ | TranslatableString | $localize`:@@SI_AI_CHAT_CONTAINER.INPUT_ARGUMENTS:Input arguments` | Label for activity input arguments. |
| activityOutputLabel ¶ | TranslatableString | $localize`:@@SI_AI_CHAT_CONTAINER.OUTPUT:Output` | Label for activity output. |
| activityReasoningLabel ¶ | TranslatableString | $localize`:@@SI_AI_CHAT_CONTAINER.REASONING:Reasoning` | Default name for reasoning activities. |
| aiIcon ¶ | string | 'element-ai' | Custom AI icon name, used for empty state |
| autoExpand ¶ | boolean | true | Whether the latest activity details are expanded automatically. |
| colorVariant ¶ | BackgroundColorVariant | 'base-0' | Color to use for component background. |
| disableInterrupt ¶ | boolean | false | Whether to disable the interrupt functionality |
| greeting ¶ | TranslatableString | $localize`:@@SI_AI_CHAT_CONTAINER.WELCOME_GREETING:Hello,` | The greeting text for the welcome screen |
| hideWelcomeScreen ¶ | boolean | false | Whether to hide the welcome screen when there are no messages and the chat is not loading. |
| interrupting ¶ | boolean | false | Whether the system is currently interrupting an operation. When true, forces interruptible mode and shows sending state on the input. |
| loading ¶ | boolean | false | Whether a pending loading AI message should be shown (e.g. while waiting for response). If you also want to prevent the user from sending new messages, set sending to true as well. |
| markdownOptions ¶ | SiMarkdownOptions | makeSiMarkdownOptions() | Options used to render chat message markdown. |
| messages ¶ | ChatMessage[] | undefined | List of chat messages to display. Messages can contain either content (string) or a template (TemplateRef) for custom rendering. When both content and template are provided, the template takes precedence. | |
| noAutoScroll ¶ | boolean | false | Disable auto-scroll to bottom when new messages are added |
| promptSuggestions ¶ | PromptSuggestion[] | Record<string, PromptSuggestion[]> | [] | The list of prompt suggestions for the welcome screen, either as an array or a record mapping category labels to suggestion arrays |
| secondaryActionsLabel ¶ | TranslatableString | $localize`:@@SI_AI_CHAT_CONTAINER.SECONDARY_ACTIONS:More actions` | More actions button aria label |
| sending ¶ | boolean | false | Whether a message is currently being sent, disables input and shows a loading state in the input area. If you want to show a loading state for the latest AI message, set loading to true instead. |
| show ¶ | ActivityDetailsDisplay | 'auto' | Which activity input and output parts are shown. |
| statusAction ¶ | { title: string; href: string; target?: string; } | undefined | Status notification action link | |
| statusHeading ¶ | string | undefined | Status notification heading | |
| statusMessage ¶ | string | undefined | Status notification message | |
| statusSeverity ¶ | "success" | "info" | "warning" | "danger" | "caution" | "critical" | undefined | Status notification severity | |
| welcomeMessage ¶ | TranslatableString | $localize`:@@SI_AI_CHAT_CONTAINER.WELCOME_MESSAGE:how can I help you today?` | The welcome message text for the welcome screen |
Output Properties¶
| Name | Type | Description |
|---|---|---|
| messageSent ¶ | { content: string; attachments: ChatInputAttachment[]; } | Emitted when a new message is sent |
Attributes and Methods¶
| Name | Type | Default | Description |
|---|---|---|---|
| focus() ¶ | () => void | Focuses the chat input component if it exists. | |
| (readonly) inputInterruptible ¶ | Signal<boolean> | ... | Implements SiChatInputParent |
| (readonly) inputSending ¶ | Signal<boolean> | ... | Implements SiChatInputParent |
| onInputSend() ¶ | () => void | Implements SiChatInputParent | |
| scrollToBottom() ¶ | () => void | Scrolls to the bottom of the messages container immediately. This method forces a scroll even if the user has scrolled up. |
Types Documentation¶
Use this type with filter components colorVariant to render component variants based on background of container
ChatMessage
| UserChatMessage | AiChatMessage | ActivityChatMessage | ActivityTraceChatMessage | TemplateChatMessage ¶Chat message type union of all supported message types in the AI chat container.
See: UserChatMessage for user messages
See: AiChatMessage for AI messages
See: ActivityChatMessage for individual activities
See: ActivityTraceChatMessage for grouped activities
See: TemplateChatMessage for template-based messages
See: BaseChatMessage for the base chat message interface
See: SiAiChatComponent for the AI chat container where this is used
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:
import { siMarkdownMathKaTeX } from '@siemens/element-ng/markdown/extensions/math';
import remarkGemoji from 'remark-gemoji';
protected markdownOptions = new SiMarkdownOptions()
.installExtension(siMarkdownMathKaTeX())
.installUnifiedPlugin(remarkGemoji);
<si-markdown [markdown]="markdownText()" [options]="markdownOptions" />
-
() => SiMarkdownOptions¶
-
getCodeTypeHandlers
() => Map<string, TypeHandler>¶Returns: All code type handlers
-
getHighlighter
() => SiMarkdownHighlighter | undefined¶Returns: The highlighter
-
getTypeHandlers
() => TypeHandler[]¶Returns: All type handlers
-
installExtension
(extension: SiMarkdownExtension) => SiMarkdownOptions¶Installs a extension which can contain plugins, type handlers
Returns: self for chaining
Parameters-
• The extension definition
-
-
installUnifiedPlugin
(plugin: UnifiedPlugin, options?: any) => SiMarkdownOptions¶Installs a plugin into the
unifiedchainReturns: self for chaining
-
makeProcessor
(meta: SiMarkdownMetadata) => Processor<Root, Root, SiMarkdownRoot, undefined, undefined>¶Creates the
unifiedprocessor with all plugins and optionsReturns:
unifiedprocessorParameters -
registerDirective
(directives: TypeHandler | TypeHandler[]) => SiMarkdownOptions¶Registers a component used to render a named Markdown directive.
Returns: self for chaining
Parameters -
setCodeHighlighter
(highlighter?: SiMarkdownHighlighter) => SiMarkdownOptions¶Sets the code highlighter
Parameters-
• The highlighter
-
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
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:
stringInherited from Attachment¶ -
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>)Inherited from Attachment¶ -
File size in bytes
-
MIME type
Parent contract used by SiChatInputComponent when it is projected into a chat container.
-
inputInterruptible:
readonlySignal<boolean>¶ -
inputSending:
readonlySignal<boolean>¶
-
onInputSend
() => void¶
User chat message for AI chats
See: SiAiChatComponent for the AI chat container where this is used
-
Actions available for this message
-
Attachments (for user messages)
-
Message content, should be a string, empty string shows loading state
content:
stringInherited from BaseChatMessage¶ -
Whether the message is currently loading/being generated - can be a boolean or Signal<boolean>
loading?:
boolean | Signal<boolean>Inherited from BaseChatMessage¶ -
Type of message
type:
"user"Inherited from BaseChatMessage¶
AI chat message
See: SiAiChatComponent for the AI chat container where this is used
-
Actions available for this message
-
Message content - can be a string or a Signal<string>, empty string shows loading state, set signal back to string to end "streaming" state
content:
string | Signal<string>Inherited from BaseChatMessage¶ -
Whether the message is currently loading/being generated - can be a boolean or Signal<boolean>
loading?:
boolean | Signal<boolean>Inherited from BaseChatMessage¶ -
Type of message
type:
"ai"Inherited from BaseChatMessage¶
Progress or intermediate activity shown between chat messages.
-
Overrides automatic expansion for this activity.
-
Overrides automatic input expansion. Record keys can be selected individually.
autoExpandInputs?:
boolean | string[]¶ -
Overrides automatic output expansion.
-
Reasoning content rendered directly in the activity.
-
Alternative icon. Set to false to show the generic activity marker.
-
Activity inputs. Record entries are rendered as individual message parts.
-
Label for the input arguments section.
-
Whether the activity is still running.
-
Nested activities.
-
Activity name. Defaults to the reasoning label for content-only activities.
-
Output from the activity.
-
Label for the output section.
Related activities grouped under a shared collapsible heading. The latest trace stays expanded until a user message follows it.
-
Overrides automatic expansion for this trace.
-
Activities in execution order.
-
Activity trace name.
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
See: SiChatMessageComponent for the chat message wrapper component which can be used inside the template
-
Template to render the message
-
Context data to pass to the template
Type handler for a named type. This can be an AST node type, a code type, a directive name
-
The component used to render the node
component:
Type<SiMarkdownExtensionComponent>Inherited from ComponentWithOptions<SiMarkdownExtensionComponent>¶ -
Options passed to the component
options?:
anyInherited from ComponentWithOptions<SiMarkdownExtensionComponent>¶ -
Type name
An extension to the si-markdown component
-
Special code type handlers to install
-
Directives
-
unifiedplugins to install -
Type handlers to install
types?:
TypeHandler[]¶
SiMarkdownRoot
Omit<Root, 'children'> & { children: ExtendedRootContent[]; references?: { footnoteDefinitions?: Map<string, FootnoteDefinition>; definitions?: Map<string, Definition>; }; } ¶Extended root with references
Options passed to makeProcessor()
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>)¶
-
Action that called when the item is triggered. A function will be called, a string will be dispatched to the SiMenuActionService.
action:
string | ((actionParam: any, source: MenuItemAction) => void)¶ -
Badge that is rendered after the label.
badge?:
string | numberInherited from MenuItemBase¶ -
Color of the badge (not iconBadge).
badgeColor?:
stringInherited from MenuItemBase¶ -
Whether the menu item id disabled.
disabled?:
booleanInherited from MenuItemBase¶ -
Optional icon that will be rendered before the label.
icon?:
stringInherited from MenuItemBase¶ -
Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.
iconBadge?:
string | number | booleanInherited from MenuItemBase¶ -
ID that will be attached to the DOM node.
id?:
stringInherited from MenuItemBase¶ -
Label that is shown to the user.
label:
TranslatableStringInherited from MenuItemBase¶
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
See: UserChatMessage for user messages
See: AiChatMessage for AI messages
See: TemplateChatMessage for template-based messages
Interface an extension component must implement
-
Node to be rendered
-
Options passed to the component
-
The parent node
Interface a code highlighter component must implement
-
The code to be highlighted
-
The language
-
Options passed to the component
-
Function the highlighter can call to updated the displayed language
updateLanguage:
InputSignal<(lang?: string) => void>¶
Citation metadata associated with a markdown response.
-
Optional source description.
description?:
stringInherited from SourceReference¶ -
Identifier referenced by bracket notation, such as
[source-1]. -
Source name displayed to the user.
name:
stringInherited from SourceReference¶ -
Zero-based, end-exclusive source range of the citation reference in the markdown source.
-
Optional source quote. Takes precedence over description.
quote?:
stringInherited from SourceReference¶ -
Source URL.
url:
stringInherited from SourceReference¶
-
Badge that is rendered after the label.
-
Color of the badge (not iconBadge).
-
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.
Extra node for collecting all footnotes
-
List of children.
children:
FootnoteDefinition[]Inherited from Parent¶ -
Info from the ecosystem.
-
Position of a node in a source document.
Nodes that are generated (not in the original source document) must not have a position.
-
Node type.
Container for one or more adjacent citation nodes.
AST node created by remark-directive.
-
Attributes declared on the directive.
attributes:
Record<string, string | undefined>¶ -
List of children.
children:
RootContent[]Inherited from Parent¶ -
Info from the ecosystem.
-
The directive name without its leading colons.
-
Position of a node in a source document.
Nodes that are generated (not in the original source document) must not have a position.
-
Node type.
type:
"containerDirective" | "leafDirective" | "textDirective"Inherited from Node¶
Inline node that references an item in the source citation array.
-
Info from the ecosystem.
-
Position of a node in a source document.
Nodes that are generated (not in the original source document) must not have a position.
-
Text replaced by a position-based citation.
-
Node type.
Except where otherwise noted, content on this site is licensed under MIT License.