# SiChatContainerComponent documentation

**Kind:** component

**Selector:** `si-chat-container`

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

A declarative container component for displaying a chat interface with automatic scroll-to-bottom behavior.

This component provides the layout and styling for a chat interface, managing scrolling behavior to keep the newest messages visible while respecting user scrolling actions. It automatically scrolls to the bottom when new content is added, unless the user has scrolled up to view older messages.

Use via content projection:

• Default content: Chat messages displayed in the scrollable messages container or a welcome screen (empty state).

• `si-inline-notification` selector: Notification component displayed above the input area

• `si-chat-input` or `[siChatContainerInput]` selector: Input controls for composing messages

See: [SiChatInputComponent](<../SiChatInputComponent/index.html#SiChatInputComponent>) for the chat input wrapper component

See: [SiChatContainerInputDirective](<../../directives/SiChatContainerInputDirective/index.html#SiChatContainerInputDirective>) for other input controls to slot in

See: [SiAiMessageComponent](<../SiAiMessageComponent/index.html#SiAiMessageComponent>) for AI messages to slot in

See: [SiUserMessageComponent](<../SiUserMessageComponent/index.html#SiUserMessageComponent>) for user messages (in AI chats) to slot in

See: [SiChatMessageComponent](<../SiChatMessageComponent/index.html#SiChatMessageComponent>) for the chat message wrapper component to slot in other messages

```
component SiChatContainerComponent implements AfterContentInit, OnDestroy
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [colorVariant](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-container.component.ts#L63-L63>) | `string` | `'base-0'` | The color variant to apply to the container. |
| [noAutoScroll](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-container.component.ts#L69-L71>) | `boolean` | `false` | Disables automatic scrolling to the bottom when new content is added. |

#### Attributes and Methods

##### focus

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

Focuses the messages container element.

```
focus(): 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-chat-container.component.ts#L195-L198>)

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

##### scrollToTop

[Source for scrollToTop](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-chat-container.component.ts#L203-L212>)

Scrolls to the top of the messages container immediately.

```
scrollToTop(): void
```

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