Skip to content

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.

AI chat

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

AI chat elements

  1. Chat input
  2. Chat message - AI
  3. Chat message - User

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.

AI chat in full page

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.

AI chat in side panel

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.

AI errors and limitations

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

  1. 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" on si-ai-chat to turn off automatic expansion by default.
  • Set autoExpand on a trace, activity, or nested activity to override the inherited setting.
  • Use autoExpandInputs and autoExpandOutputs to control expansion of individual details. For labeled inputs, pass an array of record keys to autoExpandInputs to 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.

SiAiChatComponent API Documentation

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

ActivityDetailsDisplay

'auto' | 'inputs' | 'outputs' | 'both'
type alias

BackgroundColorVariant

'base-1' | 'base-0'
type alias

Use this type with filter components colorVariant to render component variants based on background of container

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" />
Constructor
Methods

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

Properties

Parent contract used by SiChatInputComponent when it is projected into a chat container.

Properties
Methods

User chat message for AI chats

See: SiAiChatComponent for the AI chat container where this is used

Properties

AI chat message

See: SiAiChatComponent for the AI chat container where this is used

Properties

Progress or intermediate activity shown between chat messages.

Properties

Related activities grouped under a shared collapsible heading. The latest trace stays expanded until a user message follows it.

Properties

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

Properties

Type handler for a named type. This can be an AST node type, a code type, a directive name

Properties

An extension to the si-markdown component

Properties

SiMarkdownRoot

Omit<Root, 'children'> & { children: ExtendedRootContent[]; references?: { footnoteDefinitions?: Map<string, FootnoteDefinition>; definitions?: Map<string, Definition>; }; }
type alias

Extended root with references

Options passed to makeProcessor()

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

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

Properties

Interface an extension component must implement

Properties

A combination of a component and options passed to it during run-time

Properties

Combination of unified plugin with options

Properties

Interface a code highlighter component must implement

Properties

Citation metadata associated with a markdown response.

Properties

Properties

Extra node for collecting all footnotes

Properties
  • List of children.

    children : FootnoteDefinition[] Inherited from Parent

  • Info from the ecosystem.

    data ? : Data Inherited from Node

  • Position of a node in a source document.

    Nodes that are generated (not in the original source document) must not have a position.

    position ? : Position Inherited from Node

  • Node type.

    type : "footnotes" Inherited from Node

Container for one or more adjacent citation nodes.

Properties
  • children : Citation[]

  • Info from the ecosystem.

    data ? : Data Inherited from Node

  • Position of a node in a source document.

    Nodes that are generated (not in the original source document) must not have a position.

    position ? : Position Inherited from Node

  • Node type.

    type : "citations" Inherited from Node

AST node created by remark-directive.

Properties
  • Attributes declared on the directive.

    attributes : Record<string, string | undefined>

  • List of children.

    children : RootContent[] Inherited from Parent

  • Info from the ecosystem.

    data ? : Data Inherited from Node

  • The directive name without its leading colons.

    name : string

  • Position of a node in a source document.

    Nodes that are generated (not in the original source document) must not have a position.

    position ? : Position Inherited from Node

  • Node type.

    type : "containerDirective" | "leafDirective" | "textDirective" Inherited from Node

Definition of a single source

Properties

Inline node that references an item in the source citation array.

Properties
  • citationIndex : number

  • Info from the ecosystem.

    data ? : Data Inherited from Node

  • Position of a node in a source document.

    Nodes that are generated (not in the original source document) must not have a position.

    position ? : Position Inherited from Node

  • Text replaced by a position-based citation.

    text ? : string

  • Node type.

    type : "citation" Inherited from Node


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