ngx-prompt-kit

Chat Container

A scroll area that auto-sticks to the bottom on new content — but only if the user is already there. Pair with ScrollButton for a back-to-bottom affordance.

Examples

Auto-scroll on new messages

Add a message; the container scrolls to keep up. Scroll up manually and the auto-scroll yields to you — the floating button takes you back.

U Message 1 — chat scrolls to follow as new content arrives. U Message 2 — chat scrolls to follow as new content arrives. U Message 3 — chat scrolls to follow as new content arrives. U Message 4 — chat scrolls to follow as new content arrives. U Message 5 — chat scrolls to follow as new content arrives.

Installation

Add the chat-container component (and the cn() utility) to your project.

ng generate ngx-prompt-kit:chat-container

Component API

PkChatContainerRoot

PropTypeDefaultDescription
classstringExtra classes for the scroll container.
isAtBottomSignal<boolean>Read-only signal exposed via CHAT_CONTAINER_STATE.
scrollToBottom()(behavior?: ScrollBehavior) => voidMethod to programmatically scroll to bottom.

PkChatContainerContent

PropTypeDefaultDescription
classstringExtra classes for the inner flex column.

PkChatContainerScrollAnchor

PropTypeDefaultDescription
classstringExtra classes for the 1-pixel anchor element.