# 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](<https://element.siemens.io/components/chat-messages/chat-container/>) with AI-specific behavior, such as follow-up prompts and the [activity message](<https://element.siemens.io/components/chat-messages/activity-message/>) for tool calls.

![AI chat](<../images/ai-chat.png>)

### 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](<https://element.siemens.io/components/chat-messages/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](<https://element.siemens.io/components/chat-messages/chat-input/#follow-up-prompts>) after AI responses to help users continue the conversation without formulating the next message from scratch.
- Refer to [AI chat history](<https://element.siemens.io/patterns/ai/ai-chat-history/>) pattern for guidelines on displaying and managing previous AI conversations
- Refer to [conversational design](<https://ix.siemens.io/docs/guidelines/conversational-design/getting-started>) guidelines.

## Design

### Elements

![AI chat elements](<../images/ai-chat-elements.png>)

1. [Chat input](<https://element.siemens.io/components/chat-messages/chat-input/>)
2. [Chat message - AI](<https://element.siemens.io/components/chat-messages/chat-message/>)
3. [Chat message - User](<https://element.siemens.io/components/chat-messages/chat-message/>)

### 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](<../images/ai-chat-full-page.png>)

#### 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](<https://element.siemens.io/components/layout-navigation/side-panel/>).

- When the AI feature is globally accessible, the side panel can be triggered from the [application header](<https://element.siemens.io/components/layout-navigation/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](<../images/ai-chat-side-panel.png>)

### 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](<https://element.siemens.io/components/status-notifications/inline-notification/>), 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](<../images/ai-errors.png>)

### 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](<../images/ai-follow-up-prompts.png>)

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

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component, inject, signal, TemplateRef, viewChild, WritableSignal } from '@angular/core';
import {
  AiChatMessage,
  ChatMessage,
  ChatInputAttachment,
  SiAiChatComponent,
  SiChatInputComponent,
  UserChatMessage,
  PromptSuggestion
} from '@siemens/element-ng/chat-messages';
import { FileUploadError } from '@siemens/element-ng/file-uploader';
import { MenuItemAction } from '@siemens/element-ng/menu';
import { SiToastNotificationService } from '@siemens/element-ng/toast-notification';
import { LOG_EVENT } from '@siemens/live-preview';

import { markdownOptions } from './markdown-options';

@Component({
  selector: 'app-sample',
  imports: [SiAiChatComponent, SiChatInputComponent],
  templateUrl: './si-ai-chat.html'
})
export class SampleComponent {
  private logEvent = inject(LOG_EVENT);
  private readonly modalTemplate = viewChild<TemplateRef<any>>('modalTemplate');
  private readonly toastService = inject(SiToastNotificationService);
  protected readonly markdownOptions = markdownOptions;

  readonly preAttachedFiles: ChatInputAttachment[] = [
    {
      name: 'requirements.pdf',
      size: 1234567,
      type: 'application/pdf',
      file: new File([''], 'requirements.pdf', { type: 'application/pdf' })
    },
    {
      name: 'mockup.png',
      size: 654321,
      type: 'image/png',
      file: new File([''], 'mockup.png', { type: 'image/png' })
    }
  ];

  userActions: MenuItemAction[] = [
    {
      type: 'action',
      label: 'Copy message',
      icon: 'element-export',
      action: (_message: UserChatMessage) =>
        this.logEvent(`Copy user message ${_message.content.slice(0, 20)}...`)
    },
    {
      type: 'action',
      label: 'Delete message',
      icon: 'element-delete',
      action: (_message: UserChatMessage) =>
        this.logEvent(`Delete user message ${_message.content.slice(0, 20)}...`)
    }
  ];

  aiActions: MenuItemAction[] = [
    {
      type: 'action',
      label: 'Good response',
      icon: 'element-plus',
      action: (_message: AiChatMessage) => this.logEvent('Thumbs up for AI message')
    },
    {
      type: 'action',
      label: 'Copy response',
      icon: 'element-export',
      action: (_message: AiChatMessage) => this.logEvent('Copy AI message')
    }
  ];

  readonly messages = signal<ChatMessage[]>([
    {
      type: 'user',
      content: `Can you help me analyze these files?

I'm having trouble understanding the data structure
and need assistance with the implementation.`,
      attachments: [
        {
          name: 'data-analysis.py',
          previewTemplate: () => this.modalTemplate()!
        },
        {
          name: 'dataset.csv',
          previewTemplate: () => this.modalTemplate()!
        }
      ],
      actions: [
        {
          type: 'action',
          label: 'Copy message',
          icon: 'element-export',
          action: (message: UserChatMessage) =>
            this.logEvent(`Copy user message ${message.content.slice(0, 20)}...`)
        }
      ]
    },
    {
      type: 'ai',
      content: `I can analyze the Python script and CSV dataset.

I will inspect how the files are loaded and transformed.`,
      actions: this.aiActions
    },
    {
      type: 'activity-trace',
      name: 'Analyzing the attached files',
      autoExpand: true,
      messages: [
        {
          type: 'activity',
          name: 'Searching documentation',
          icon: 'element-search',
          content: 'Found the relevant dashboard and KPI guidance.'
        },
        {
          type: 'activity',
          name: 'Reading relevant files',
          icon: 'element-document',
          content: 'Loaded `data-analysis.py` and `dataset.csv`.'
        },
        {
          type: 'activity',
          name: 'Computing KPI values',
          icon: 'element-function',
          content: 'Calculated the requested performance indicators.'
        },
        {
          type: 'activity',
          name: 'Generating dashboard',
          icon: 'element-generate',
          content: 'Created the dashboard layout and KPI cards.'
        },
        {
          type: 'activity',
          name: 'Dashboard ready',
          icon: 'element-checked',
          content: 'Validated the generated dashboard.'
        }
      ]
    },
    {
      type: 'ai',
      content:
        'The files use compatible structures. The eager data-loading step is the main performance constraint.',
      actions: this.aiActions
    },
    {
      type: 'user',
      content: 'What should I optimize first if the dataset can contain several million rows?',
      actions: this.userActions
    },
    {
      type: 'activity',
      name: 'Reasoning',
      icon: 'element-self-learning',
      content: 'The data is loaded eagerly, so chunked processing should be the first improvement.'
    },
    {
      type: 'activity',
      name: 'Computing performance impact',
      icon: 'element-function',
      input: {
        Files: 'data-analysis.py, dataset.csv',
        Focus: 'performance'
      },
      output: 'Chunked processing reduces peak memory usage.',
      autoExpand: true,
      autoExpandInputs: ['Focus'],
      autoExpandOutputs: false
    },
    {
      type: 'ai',
      content: 'Process the CSV in chunks first, then profile the transformation steps.',
      actions: this.aiActions
    }
  ]);

  readonly loading = signal(false);
  readonly sending = signal(false);
  readonly disabled = signal(false);
  readonly disableInterrupt = signal(false);
  readonly interrupting = signal(false);
  readonly inputValue = signal('');

  readonly promptSuggestionsByCategory: Record<string, PromptSuggestion[]> = {
    Maintenance: [
      { text: 'Schedule preventive maintenance tasks' },
      { text: 'Generate maintenance reports' },
      { text: 'Track equipment downtime' }
    ],
    Analytics: [
      { text: 'Analyze performance metrics' },
      { text: 'Generate data visualizations' },
      { text: 'Create predictive models' }
    ],
    Troubleshooting: [
      { text: 'Debug connection issues' },
      { text: 'Investigate performance bottlenecks' },
      { text: 'Resolve configuration errors' }
    ]
  };

  inputActions: MenuItemAction[] = [
    {
      type: 'action',
      label: 'Clear messages',
      icon: 'element-delete',
      action: () => this.onClearMessages()
    }
  ];

  onClearMessages(): void {
    this.logEvent('Clear messages clicked');
    this.messages.set([]);
  }

  onMessageSent(event: { content: string; attachments: ChatInputAttachment[] }): void {
    this.logEvent(`Message sent: "${event.content}" with ${event.attachments.length} attachments`);
    this.addMessage(this.messages, event);
  }

  onInterrupt(): void {
    this.logEvent('Interrupt clicked');
    this.loading.set(false);
    this.interrupting.set(false);
  }

  onFileError(error: FileUploadError): void {
    this.logEvent(`File error: ${error.errorText} - ${error.fileName}`);
    this.toastService.queueToastNotification('danger', error.errorText, error.fileName);
  }

  toggleLoading(): void {
    this.loading.update(current => !current);
  }

  toggleSending(): void {
    this.sending.update(current => !current);
  }

  toggleDisabled(): void {
    this.disabled.update(current => !current);
  }

  toggleDisableInterrupt(): void {
    this.disableInterrupt.update(current => !current);
  }

  toggleInterrupting(): void {
    this.interrupting.update(current => !current);
  }

  private addMessage(
    messagesSignal: WritableSignal<ChatMessage[]>,
    event: { content: string; attachments: ChatInputAttachment[] }
  ): void {
    const userMessage: ChatMessage = {
      type: 'user',
      content: event.content,
      attachments: event.attachments.map(att => ({
        ...att,
        previewTemplate: this.modalTemplate()
      })),
      actions: this.userActions
    };

    messagesSignal.update((current: ChatMessage[]) => [...current, userMessage]);
    this.simulateAiResponse(event.content, event.attachments, messagesSignal);
  }

  simulateAiResponse(
    userInput: string,
    attachments: ChatInputAttachment[],
    messagesSignal: any
  ): void {
    this.sending.set(true);

    setTimeout(() => {
      this.sending.set(false);
      this.loading.set(true);

      setTimeout(() => {
        const response = `Thanks for your message: "${userInput}". I can help with that!`;

        messagesSignal.update((current: ChatMessage[]) => [
          ...current,
          {
            type: 'ai',
            content: response,
            actions: this.aiActions
          }
        ]);
        this.loading.set(false);
      }, 2000);
    }, 1000);
  }
}
```

Template:

```html
<div class="si-layout-fixed-height w-100 h-100">
  <si-ai-chat
    statusSeverity="info"
    statusMessage="AI responses are for demonstration purposes."
    colorVariant="base-0"
    show="both"
    [autoExpand]="true"
    [messages]="messages()"
    [sending]="sending()"
    [loading]="loading()"
    [disableInterrupt]="disableInterrupt()"
    [interrupting]="interrupting()"
    [markdownOptions]="markdownOptions"
    [promptSuggestions]="promptSuggestionsByCategory"
  >
    <si-chat-input
      class="w-100"
      placeholder="Enter a command, question or topic…"
      disclaimer="The content is AI generated. Always verify the information for accuracy."
      accept="image/*,.pdf,.doc,.docx,.txt"
      [disabled]="disabled()"
      [allowAttachments]="true"
      [actions]="inputActions"
      [autoFocus]="true"
      [attachments]="preAttachedFiles"
      [maxFileSize]="5242880"
      [value]="inputValue()"
      (send)="onMessageSent($event)"
      (interrupt)="onInterrupt()"
      (fileError)="onFileError($event)"
    />
  </si-ai-chat>
</div>

<ng-template #modalTemplate let-modalRef="modalRef" let-attachment="attachment">
  <div class="modal-header">
    <h4 class="modal-title" id="sample-modal-title">{{ attachment.name }}</h4>
    <button
      type="button"
      class="btn btn-circle btn-sm btn-ghost element-cancel"
      aria-label="Close modal"
      (click)="modalRef.hide('cancel')"
    >
    </button>
  </div>
  <div class="modal-body">
    <span>This is a sample modal to demonstrate attachment preview functionality.</span>
  </div>
</ng-template>
```

### Welcome screen

By default, the built-in [AI welcome screen](<https://element.siemens.io/components/chat-messages/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](<https://element.siemens.io/components/chat-messages/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](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L97-L642>)

**Kind:** component

**Selector:** `si-ai-chat`

```
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](<index.html#t:ChatMessage>) for the chat message model

See: [AiChatMessage](<index.html#t:AiChatMessage>) for the AI chat message model

See: [UserChatMessage](<index.html#t:UserChatMessage>) for the user chat message model

See: [TemplateChatMessage](<index.html#t:TemplateChatMessage>) for the template chat message model

See: [SiChatInputComponent](<../../../api/siemens/element-ng/components/SiChatInputComponent/index.html#SiChatInputComponent>) for the chat input component

See: [SiChatContainerComponent](<../../../api/siemens/element-ng/components/SiChatContainerComponent/index.html#SiChatContainerComponent>) for the base chat container component

See: [SiAiMessageComponent](<../../../api/siemens/element-ng/components/SiAiMessageComponent/index.html#SiAiMessageComponent>) for the used AI message component

See: [SiUserMessageComponent](<../../../api/siemens/element-ng/components/SiUserMessageComponent/index.html#SiUserMessageComponent>) for the used user message component

See: [SiChatMessageComponent](<../../../api/siemens/element-ng/components/SiChatMessageComponent/index.html#SiChatMessageComponent>) for the base wrapper chat message component used by AI and user message components

```
component SiAiChatComponent implements SiChatInputParent
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [activityInputArgumentsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L255-L257>) | `TranslatableString` | `` $localize`:@@SI_AI_CHAT_CONTAINER.INPUT_ARGUMENTS:Input arguments` `` | Label for activity input arguments. |
| [activityOutputLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L266-L266>) | `TranslatableString` | `` $localize`:@@SI_AI_CHAT_CONTAINER.OUTPUT:Output` `` | Label for activity output. |
| [activityReasoningLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L275-L277>) | `TranslatableString` | `` $localize`:@@SI_AI_CHAT_CONTAINER.REASONING:Reasoning` `` | Default name for reasoning activities. |
| [aiIcon](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L165-L165>) | `string` | `'element-ai'` | Custom AI icon name, used for empty state |
| [autoExpand](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L120-L120>) | `boolean` | `true` | Whether the latest activity details are expanded automatically. |
| [colorVariant](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L171-L171>) | `BackgroundColorVariant` | `'base-0'` | Color to use for component background. |
| [disableInterrupt](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L146-L146>) | `boolean` | `false` | Whether to disable the interrupt functionality |
| [greeting](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L195-L195>) | `TranslatableString` | `` $localize`:@@SI_AI_CHAT_CONTAINER.WELCOME_GREETING:Hello,` `` | The greeting text for the welcome screen |
| [hideWelcomeScreen](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L186-L186>) | `boolean` | `false` | Whether to hide the welcome screen when there are no messages and the chat is not loading. |
| [interrupting](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L153-L153>) | `boolean` | `false` | Whether the system is currently interrupting an operation. When true, forces interruptible mode and shows sending state on the input. |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L140-L140>) | `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](<index.html#SiAiChatComponent.sending>) to true as well. |
| [markdownOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L180-L180>) | `SiMarkdownOptions` | `makeSiMarkdownOptions()` | Options used to render chat message markdown. |
| [messages](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L114-L114>) | `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](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L159-L159>) | `boolean` | `false` | Disable auto-scroll to bottom when new messages are added |
| [promptSuggestions](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L212-L212>) | `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](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L222-L224>) | `TranslatableString` | `` $localize`:@@SI_AI_CHAT_CONTAINER.SECONDARY_ACTIONS:More actions` `` | More actions button aria label |
| [sending](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L133-L133>) | `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](<index.html#SiAiChatComponent.loading>) to true instead. |
| [show](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L126-L126>) | `ActivityDetailsDisplay` | `'auto'` | Which activity input and output parts are shown. |
| [statusAction](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L246-L246>) | `{ title: string; href: string; target?: string; } \| undefined` |  | Status notification action link |
| [statusHeading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L236-L236>) | `string \| undefined` |  | Status notification heading |
| [statusMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L241-L241>) | `string \| undefined` |  | Status notification message |
| [statusSeverity](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L229-L231>) | `"success" \| "info" \| "warning" \| "danger" \| "caution" \| "critical" \| undefined` |  | Status notification severity |
| [welcomeMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L204-L206>) | `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](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L282-L285>) | `{ content: string; attachments: ChatInputAttachment[]; }` | Emitted when a new message is sent |

#### Attributes and Methods

##### focus

[Source for focus](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L406-L411>)

Focuses the chat input component if it exists.

```
focus(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### inputInterruptible

[Source for inputInterruptible](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L327-L329>)

**Modifiers:** readonly

**Type:** `Signal<boolean>`

**Default:** `...`

Implements [SiChatInputParent](<index.html#t:SiChatInputParent>)

##### inputSending

[Source for inputSending](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L331-L333>)

**Modifiers:** readonly

**Type:** `Signal<boolean>`

**Default:** `...`

Implements [SiChatInputParent](<index.html#t:SiChatInputParent>)

##### onInputSend

[Source for onInputSend](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L399-L401>)

Implements [SiChatInputParent](<index.html#t:SiChatInputParent>)

```
onInputSend(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

##### scrollToBottom

[Source for scrollToBottom](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-chat.component.ts#L395-L397>)

Scrolls to the bottom of the messages container immediately. This method forces a scroll even if the user has scrolled up.

```
scrollToBottom(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### Types Documentation

### [ActivityDetailsDisplay](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L11-L11>)

**Kind:** type alias

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

```
type ActivityDetailsDisplay = 'auto' | 'inputs' | 'outputs' | 'both'
```

### [BackgroundColorVariant](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/color-variant.model.ts#L8-L8>)

**Kind:** type alias

```
import type { BackgroundColorVariant } from '@siemens/element-ng/common';
```

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

```
type BackgroundColorVariant = 'base-1' | 'base-0'
```

### [ChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L141-L146>)

**Kind:** type alias

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

Chat message type union of all supported message types in the AI chat container.

See: [UserChatMessage](<index.html#t:UserChatMessage>) for user messages

See: [AiChatMessage](<index.html#t:AiChatMessage>) for AI messages

See: [ActivityChatMessage](<index.html#t:ActivityChatMessage>) for individual activities

See: [ActivityTraceChatMessage](<index.html#t:ActivityTraceChatMessage>) for grouped activities

See: [TemplateChatMessage](<index.html#t:TemplateChatMessage>) for template-based messages

See: [BaseChatMessage](<index.html#t:BaseChatMessage>) for the base chat message interface

See: [SiAiChatComponent](<index.html#SiAiChatComponent>) for the AI chat container where this is used

```
type ChatMessage = | UserChatMessage
  | AiChatMessage
  | ActivityChatMessage
  | ActivityTraceChatMessage
  | TemplateChatMessage
```

### [PromptSuggestion](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-welcome-screen.component.ts#L14-L16>)

**Kind:** interface

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

```
interface PromptSuggestion
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [text](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-ai-welcome-screen.component.ts#L15-L15>) | `TranslatableString` |  |

### [SiMarkdownOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L47-L158>)

**Kind:** class

```
import { SiMarkdownOptions } from '@siemens/element-ng/markdown';
```

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:

```ts
import { siMarkdownMathKaTeX } from '@siemens/element-ng/markdown/extensions/math';
import remarkGemoji from 'remark-gemoji';

protected markdownOptions = new SiMarkdownOptions()
  .installExtension(siMarkdownMathKaTeX())
  .installUnifiedPlugin(remarkGemoji);
```

```html
<si-markdown [markdown]="markdownText()" [options]="markdownOptions" />
```

```
undecorated_class SiMarkdownOptions
```

#### Constructor

##### constructor

[Source for constructor](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L54-L61>)

```
constructor(): SiMarkdownOptions
```

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

#### Methods

##### getCodeTypeHandlers

[Source for getCodeTypeHandlers](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L148-L150>)

Returns: All code type handlers

```
getCodeTypeHandlers(): Map<string, TypeHandler>
```

**Returns:** [Map](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map>)`<`[string](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String>)`, `[TypeHandler](<index.html#t:TypeHandler>)`>`

##### getHighlighter

[Source for getHighlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L155-L157>)

Returns: The highlighter

```
getHighlighter(): SiMarkdownHighlighter | undefined
```

**Returns:** [SiMarkdownHighlighter](<index.html#t:SiMarkdownHighlighter>)`  |  `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)

##### getTypeHandlers

[Source for getTypeHandlers](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L141-L143>)

Returns: All type handlers

```
getTypeHandlers(): TypeHandler[]
```

**Returns:** [TypeHandler](<index.html#t:TypeHandler>)`[]`

##### installExtension

[Source for installExtension](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L94-L110>)

Installs a extension which can contain plugins, type handlers

Returns: self for chaining

```
installExtension(extension: SiMarkdownExtension): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [extension](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L94-L94>) | `SiMarkdownExtension` |  | • The extension definition |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

##### installUnifiedPlugin

[Source for installUnifiedPlugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L69-L72>)

Installs a plugin into the `unified` chain

Returns: self for chaining

```
installUnifiedPlugin(plugin: UnifiedPlugin, options?: any): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [plugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L69-L69>) | `UnifiedPlugin` |  | • The `unified` plugin |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L69-L69>) (optional) | `any` |  | • Options for the plugin |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

##### makeProcessor

[Source for makeProcessor](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L125-L136>)

Creates the `unified` processor with all plugins and options

Returns: `unified` processor

```
makeProcessor(meta: SiMarkdownMetadata): Processor<Root, Root, SiMarkdownRoot, undefined, undefined>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [meta](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L126-L126>) | `SiMarkdownMetadata` |  |  |

**Returns:** [Processor](<https://unifiedjs.com>)`<`[Root](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>)`, `[Root](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>)`, `[SiMarkdownRoot](<index.html#t:SiMarkdownRoot>)`, `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`, `[undefined](<https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined>)`>`

##### registerDirective

[Source for registerDirective](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L79-L87>)

Registers a component used to render a named Markdown directive.

Returns: self for chaining

```
registerDirective(directives: TypeHandler | TypeHandler[]): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [directives](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L79-L79>) | `TypeHandler \| TypeHandler[]` |  |  |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

##### setCodeHighlighter

[Source for setCodeHighlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L116-L119>)

Sets the code highlighter

```
setCodeHighlighter(highlighter?: SiMarkdownHighlighter): SiMarkdownOptions
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [highlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown-options.ts#L116-L116>) (optional) | `SiMarkdownHighlighter` |  | • The highlighter |

**Returns:** [SiMarkdownOptions](<index.html#t:SiMarkdownOptions>)

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

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

```
type TranslatableString = string & Translatable
```

### [ChatInputAttachment](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input.component.ts#L58-L65>)

**Kind:** interface

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

Attachment item interface for file attachments in chat messages, extension of [Attachment](<index.html#t:Attachment>) for [SiAttachmentListComponent](<../../../api/siemens/element-ng/components/SiAttachmentListComponent/index.html#SiAttachmentListComponent>) to use within [SiChatInputComponent](<../../../api/siemens/element-ng/components/SiChatInputComponent/index.html#SiChatInputComponent>). Adds the action file information. Can be used within [SiChatContainerComponent](<../../../api/siemens/element-ng/components/SiChatContainerComponent/index.html#SiChatContainerComponent>).

See: [Attachment](<index.html#t:Attachment>) for base attachment interface

See: [SiAttachmentListComponent](<../../../api/siemens/element-ng/components/SiAttachmentListComponent/index.html#SiAttachmentListComponent>) for the attachment list component

See: [SiChatInputComponent](<../../../api/siemens/element-ng/components/SiChatInputComponent/index.html#SiChatInputComponent>) for the chat input component

See: [SiChatContainerComponent](<../../../api/siemens/element-ng/components/SiChatContainerComponent/index.html#SiChatContainerComponent>) for the base chat container component where this can be used

See: [SiAiChatComponent](<index.html#SiAiChatComponent>) for the AI chat container where this needs to be used

```
interface ChatInputAttachment extends Attachment
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [file](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input.component.ts#L60-L60>) | `File` | File object |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L22-L22>) (inherited) | `string` | File name<br><br>Inherited from [Attachment](<index.html#t:Attachment>) |
| [previewTemplate](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L24-L24>) (optional, inherited) | `TemplateRef<any> \| (() => TemplateRef<any>)` | Optionally show a preview of the attachment by providing a template that is shown in a modal when clicked (optional)<br><br>Inherited from [Attachment](<index.html#t:Attachment>) |
| [size](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input.component.ts#L62-L62>) | `number` | File size in bytes |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input.component.ts#L64-L64>) | `string` | MIME type |

### [SiChatInputParent](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input-token.ts#L10-L14>)

**Kind:** interface

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

Parent contract used by [SiChatInputComponent](<../../../api/siemens/element-ng/components/SiChatInputComponent/index.html#SiChatInputComponent>) when it is projected into a chat container.

```
interface SiChatInputParent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [inputInterruptible](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input-token.ts#L12-L12>) (readonly) | `Signal<boolean>` |  |
| [inputSending](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input-token.ts#L11-L11>) (readonly) | `Signal<boolean>` |  |

#### Methods

##### onInputSend

[Source for onInputSend](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-input-token.ts#L13-L13>)

```
onInputSend(): void
```

**Returns:** [void](<https://www.typescriptlang.org/docs/handbook/2/functions.html#void>)

### [UserChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L40-L49>)

**Kind:** interface

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

User chat message for AI chats

See: [SiAiChatComponent](<index.html#SiAiChatComponent>) for the AI chat container where this is used

```
interface UserChatMessage extends BaseChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [actions](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L48-L48>) (optional) | `MenuItemAction[]` | Actions available for this message |
| [attachments](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L46-L46>) (optional) | `Attachment[]` | Attachments (for user messages) |
| [content](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L44-L44>) | `string` | Message content, should be a string, empty string shows loading state<br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L30-L30>) (optional, inherited) | `boolean \| Signal<boolean>` | Whether the message is currently loading/being generated - can be a boolean or Signal\<boolean\><br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L42-L42>) | `"user"` | Type of message<br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |

### [AiChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L58-L65>)

**Kind:** interface

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

AI chat message

See: [SiAiChatComponent](<index.html#SiAiChatComponent>) for the AI chat container where this is used

```
interface AiChatMessage extends BaseChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [actions](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L64-L64>) (optional) | `MenuItemAction[]` | Actions available for this message |
| [content](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L62-L62>) | `string \| Signal<string>` | Message content - can be a string or a Signal\<string\>, empty string shows loading state, set signal back to string to end "streaming" state<br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L30-L30>) (optional, inherited) | `boolean \| Signal<boolean>` | Whether the message is currently loading/being generated - can be a boolean or Signal\<boolean\><br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L60-L60>) | `"ai"` | Type of message<br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |

### [ActivityChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L68-L94>)

**Kind:** interface

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

Progress or intermediate activity shown between chat messages.

```
interface ActivityChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [autoExpand](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L89-L89>) (optional) | `boolean` | Overrides automatic expansion for this activity. |
| [autoExpandInputs](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L91-L91>) (optional) | `boolean \| string[]` | Overrides automatic input expansion. Record keys can be selected individually. |
| [autoExpandOutputs](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L93-L93>) (optional) | `boolean` | Overrides automatic output expansion. |
| [content](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L81-L81>) (optional) | `string \| Signal<string>` | Reasoning content rendered directly in the activity. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L85-L85>) (optional) | `string \| false` | Alternative icon. Set to false to show the generic activity marker. |
| [input](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L73-L73>) (optional) | `string \| string[] \| Record<string, string>` | Activity inputs. Record entries are rendered as individual message parts. |
| [inputArgumentsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L75-L75>) (optional) | `TranslatableString` | Label for the input arguments section. |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L83-L83>) (optional) | `boolean \| Signal<boolean>` | Whether the activity is still running. |
| [messages](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L87-L87>) (optional) | `ActivityChatMessage[]` | Nested activities. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L71-L71>) (optional) | `TranslatableString` | Activity name. Defaults to the reasoning label for content-only activities. |
| [output](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L77-L77>) (optional) | `string` | Output from the activity. |
| [outputLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L79-L79>) (optional) | `TranslatableString` | Label for the output section. |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L69-L69>) | `"activity"` |  |

### [ActivityTraceChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L100-L108>)

**Kind:** interface

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

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

```
interface ActivityTraceChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [autoExpand](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L107-L107>) (optional) | `boolean` | Overrides automatic expansion for this trace. |
| [messages](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L105-L105>) | `ActivityChatMessage[]` | Activities in execution order. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L103-L103>) | `TranslatableString` | Activity trace name. |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L101-L101>) | `"activity-trace"` |  |

### [TemplateChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L118-L126>)

**Kind:** interface

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

Render custom chat message via template, consider using [SiChatMessageComponent](<../../../api/siemens/element-ng/components/SiChatMessageComponent/index.html#SiChatMessageComponent>) inside the template for consistent styling

See: [SiAiChatComponent](<index.html#SiAiChatComponent>) for the AI chat container where this is used

See: [SiChatMessageComponent](<../../../api/siemens/element-ng/components/SiChatMessageComponent/index.html#SiChatMessageComponent>) for the chat message wrapper component which can be used inside the template

```
interface TemplateChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [template](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L122-L122>) | `TemplateRef<any>` | Template to render the message |
| [templateContext](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L125-L125>) (optional) | `any` | Context data to pass to the template |

### [UnifiedPlugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L64-L64>)

**Kind:** type alias

```
import type { UnifiedPlugin } from '@siemens/element-ng/markdown';
```

```
type UnifiedPlugin = Plugin<any> | Transformer<any> | Preset | PluggableList
```

### [TypeHandler](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L48-L51>)

**Kind:** interface

```
import type { TypeHandler } from '@siemens/element-ng/markdown';
```

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

```
interface TypeHandler extends ComponentWithOptions<SiMarkdownExtensionComponent>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [component](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L42-L42>) (inherited) | `Type<SiMarkdownExtensionComponent>` | The component used to render the node<br><br>Inherited from [ComponentWithOptions\<SiMarkdownExtensionComponent\>](<index.html#t:ComponentWithOptions>) |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L44-L44>) (optional, inherited) | `any` | Options passed to the component<br><br>Inherited from [ComponentWithOptions\<SiMarkdownExtensionComponent\>](<index.html#t:ComponentWithOptions>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L50-L50>) | `string` | Type name |

### [SiMarkdownExtension](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L77-L86>)

**Kind:** interface

```
import type { SiMarkdownExtension } from '@siemens/element-ng/markdown';
```

An extension to the si-markdown component

```
interface SiMarkdownExtension
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [codeTypes](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L83-L83>) (optional) | `TypeHandler[]` | Special code type handlers to install |
| [directives](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L85-L85>) (optional) | `TypeHandler[]` | Directives |
| [plugins](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L79-L79>) (optional) | `PluginWithOptions[]` | `unified` plugins to install |
| [types](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L81-L81>) (optional) | `TypeHandler[]` | Type handlers to install |

### [SiMarkdownHighlighter](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L62-L62>)

**Kind:** type alias

```
import type { SiMarkdownHighlighter } from '@siemens/element-ng/markdown';
```

```
type SiMarkdownHighlighter = ComponentWithOptions<SiMarkdownHighlighterComponent>
```

### [SiMarkdownRoot](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L127-L133>)

**Kind:** type alias

```
import type { SiMarkdownRoot } from '@siemens/element-ng/markdown';
```

Extended root with references

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

### [SiMarkdownMetadata](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L100-L102>)

**Kind:** interface

```
import type { SiMarkdownMetadata } from '@siemens/element-ng/markdown';
```

Options passed to makeProcessor()

```
interface SiMarkdownMetadata
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [citations](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L101-L101>) (optional) | `SiMarkdownCitation[]` |  |

### [Attachment](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L20-L25>)

**Kind:** interface

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

Attachment item interface for file attachments in chat messages, used by [SiAttachmentListComponent](<../../../api/siemens/element-ng/components/SiAttachmentListComponent/index.html#SiAttachmentListComponent>) and inside [SiUserMessageComponent](<../../../api/siemens/element-ng/components/SiUserMessageComponent/index.html#SiUserMessageComponent>) as well as [SiChatInputComponent](<../../../api/siemens/element-ng/components/SiChatInputComponent/index.html#SiChatInputComponent>).

See: [SiAttachmentListComponent](<../../../api/siemens/element-ng/components/SiAttachmentListComponent/index.html#SiAttachmentListComponent>) for the attachment list component

See: [SiUserMessageComponent](<../../../api/siemens/element-ng/components/SiUserMessageComponent/index.html#SiUserMessageComponent>) for the user message

See: [SiChatInputComponent](<../../../api/siemens/element-ng/components/SiChatInputComponent/index.html#SiChatInputComponent>) for the chat input component

```
interface Attachment
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L22-L22>) | `string` | File name |
| [previewTemplate](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L24-L24>) (optional) | `TemplateRef<any> \| (() => TemplateRef<any>)` | Optionally show a preview of the attachment by providing a template that is shown in a modal when clicked (optional) |

### [MenuItemAction](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L34-L41>)

**Kind:** interface

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

```
interface MenuItemAction extends MenuItemBase
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [action](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L40-L40>) | `string \| ((actionParam: any, source: MenuItemAction) => void)` | Action that called when the item is triggered. A function will be called, a string will be dispatched to the [SiMenuActionService](<../../../api/siemens/element-ng/types/SiMenuActionService/index.html#t:SiMenuActionService>). |
| [badge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L21-L21>) (optional, inherited) | `string \| number` | Badge that is rendered after the label.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [badgeColor](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L23-L23>) (optional, inherited) | `string` | Color of the badge (not iconBadge).<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L25-L25>) (optional, inherited) | `boolean` | Whether the menu item id disabled.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L14-L14>) (optional, inherited) | `string` | Optional icon that will be rendered before the label.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [iconBadge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L19-L19>) (optional, inherited) | `string \| number \| boolean` | Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L10-L10>) (optional, inherited) | `string` | ID that will be attached to the DOM node.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L12-L12>) (inherited) | `TranslatableString` | Label that is shown to the user.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L35-L35>) | `"action"` |  |

### [BaseChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L24-L31>)

**Kind:** interface

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

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](<index.html#t:ChatMessage>) for the chat message type union

See: [UserChatMessage](<index.html#t:UserChatMessage>) for user messages

See: [AiChatMessage](<index.html#t:AiChatMessage>) for AI messages

See: [TemplateChatMessage](<index.html#t:TemplateChatMessage>) for template-based messages

```
interface BaseChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [content](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L28-L28>) (optional) | `string \| Signal<string>` | Message content - can be a string or a Signal\<string\>, empty string shows loading state |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L30-L30>) (optional) | `boolean \| Signal<boolean>` | Whether the message is currently loading/being generated - can be a boolean or Signal\<boolean\> |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L26-L26>) | `"user" \| "ai"` | Type of message |

### [SiMarkdownExtensionComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L18-L25>)

**Kind:** interface

```
import type { SiMarkdownExtensionComponent } from '@siemens/element-ng/markdown';
```

Interface an extension component must implement

```
interface SiMarkdownExtensionComponent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [node](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L20-L20>) | `InputSignal<Node>` | Node to be rendered |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L24-L24>) | `InputSignal<any>` | Options passed to the component |
| [parent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L22-L22>) | `InputSignal<Parent>` | The parent node |

### [ComponentWithOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L40-L45>)

**Kind:** interface

```
import type { ComponentWithOptions } from '@siemens/element-ng/markdown';
```

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

```
interface ComponentWithOptions<T>
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [component](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L42-L42>) | `Type<T>` | The component used to render the node |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L44-L44>) (optional) | `any` | Options passed to the component |

### [PluginWithOptions](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L69-L74>)

**Kind:** interface

```
import type { PluginWithOptions } from '@siemens/element-ng/markdown';
```

Combination of unified plugin with options

```
interface PluginWithOptions
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L73-L73>) (optional) | `any` | Options passed during plugin registration |
| [plugin](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L71-L71>) | `UnifiedPlugin` | The plugin |

### [SiMarkdownHighlighterComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L28-L37>)

**Kind:** interface

```
import type { SiMarkdownHighlighterComponent } from '@siemens/element-ng/markdown';
```

Interface a code highlighter component must implement

```
interface SiMarkdownHighlighterComponent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [code](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L30-L30>) | `InputSignal<string>` | The code to be highlighted |
| [language](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L32-L32>) | `InputSignal<string>` | The language |
| [options](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L36-L36>) | `InputSignal<any>` | Options passed to the component |
| [updateLanguage](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L34-L34>) | `InputSignal<(lang?: string) => void>` | Function the highlighter can call to updated the displayed language |

### [ExtendedRootContent](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L124-L124>)

**Kind:** type alias

```
import type { ExtendedRootContent } from '@siemens/element-ng/markdown';
```

```
type ExtendedRootContent = RootContent | Footnotes | Citations | DirectiveNode
```

### [SiMarkdownCitation](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L89-L97>)

**Kind:** interface

```
import type { SiMarkdownCitation } from '@siemens/element-ng/markdown';
```

Citation metadata associated with a markdown response.

```
interface SiMarkdownCitation extends SourceReference
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [description](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L13-L13>) (optional, inherited) | `string` | Optional source description.<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |
| [identifier](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L91-L91>) (optional) | `string` | Identifier referenced by bracket notation, such as `[source-1]`. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L9-L9>) (inherited) | `string` | Source name displayed to the user.<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |
| [position](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L93-L96>) (optional) | `{ startIndex: number; endIndex: number; }` | Zero-based, end-exclusive source range of the citation reference in the markdown source. |
| [quote](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L15-L15>) (optional, inherited) | `string` | Optional source quote. Takes precedence over [description](<index.html#t:SiMarkdownCitation.description>).<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |
| [url](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L11-L11>) (inherited) | `string` | Source URL.<br><br>Inherited from [SourceReference](<index.html#t:SourceReference>) |

### [MenuItemBase](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L8-L26>)

**Kind:** interface

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

```
interface MenuItemBase
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [badge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L21-L21>) (optional) | `string \| number` | Badge that is rendered after the label. |
| [badgeColor](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L23-L23>) (optional) | `string` | Color of the badge (not iconBadge). |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L25-L25>) (optional) | `boolean` | Whether the menu item id disabled. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L14-L14>) (optional) | `string` | Optional icon that will be rendered before the label. |
| [iconBadge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L19-L19>) (optional) | `string \| number \| boolean` | Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L10-L10>) (optional) | `string` | ID that will be attached to the DOM node. |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L12-L12>) | `TranslatableString` | Label that is shown to the user. |

### [Footnotes](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L119-L122>)

**Kind:** interface

```
import type { Footnotes } from '@siemens/element-ng/markdown';
```

Extra node for collecting all footnotes

```
interface Footnotes extends Parent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [children](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L121-L121>) | `FootnoteDefinition[]` | List of children.<br><br>Inherited from [Parent](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L120-L120>) | `"footnotes"` | Node type.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |

### [Citations](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L113-L116>)

**Kind:** interface

```
import type { Citations } from '@siemens/element-ng/markdown';
```

Container for one or more adjacent citation nodes.

```
interface Citations extends Node
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [children](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L115-L115>) | `Citation[]` |  |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L114-L114>) | `"citations"` | Node type.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |

### [DirectiveNode](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L54-L60>)

**Kind:** interface

```
import type { DirectiveNode } from '@siemens/element-ng/markdown';
```

AST node created by `remark-directive`.

```
interface DirectiveNode extends Parent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [attributes](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L59-L59>) | `Record<string, string \| undefined>` | Attributes declared on the directive. |
| children (inherited) | `RootContent[]` | List of children.<br><br>Inherited from [Parent](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L57-L57>) | `string` | The directive name without its leading colons. |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L55-L55>) | `"containerDirective" \| "leafDirective" \| "textDirective"` | Node type.<br><br>Inherited from [Node](<https://developer.mozilla.org/docs/Web/API/Node>) |

### [SourceReference](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L7-L16>)

**Kind:** interface

```
import type { SourceReference } from '@siemens/element-ng/source-chip';
```

Definition of a single source

```
interface SourceReference
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [description](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L13-L13>) (optional) | `string` | Optional source description. |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L9-L9>) | `string` | Source name displayed to the user. |
| [quote](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L15-L15>) (optional) | `string` | Optional source quote. Takes precedence over [description](<index.html#t:SourceReference.description>). |
| [url](<https://github.com/siemens/element/blob/main/projects/element-ng/source-chip/si-source-chip.model.ts#L11-L11>) | `string` | Source URL. |

### [Citation](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L105-L110>)

**Kind:** interface

```
import type { Citation } from '@siemens/element-ng/markdown';
```

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

```
interface Citation extends Node
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [citationIndex](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L107-L107>) | `number` |  |
| data (optional, inherited) | `Data` | Info from the ecosystem.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| position (optional, inherited) | `Position` | Position of a node in a source document.<br><br>Nodes that are generated (not in the original source document) must not have a position.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
| [text](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L109-L109>) (optional) | `string` | Text replaced by a position-based citation. |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/markdown/si-markdown.types.ts#L106-L106>) | `"citation"` | Node type.<br><br>Inherited from [Node](<https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast>) |
