YuhuanStudioYunUIDocs
Chat

Chat Message List

A scroll container with smart stick-to-bottom and an empty-state slot; the IntersectionObserver root for lazy content images.

A scrollable message container with smart stick-to-bottom. As content grows it auto-scrolls to the newest message — but only while the user is already near the bottom, so scrolling up to re-read is never interrupted. It marks itself with data-scroll-container="true" so lazy content images (from @yuhuanowo/yunui/content) use it as their IntersectionObserver root. Place it as the flexible middle of a flex flex-col shell, between a header and a composer.

Import

tsx
1import { ChatMessageList } from "@yuhuanowo/yunui/chat";

Example

Scroll up and the list stays put; it only re-sticks to the bottom when you're already there.

ChatMessageList

You
What is YunUI?
Assistant
A versioned React 19 + Tailwind v4 design system.
You
Does it help with chat UIs?
Assistant
Yes — the chat subpath ships message rows, a smart list, a composer and a header.

Empty state

Pass an empty node to show a centered placeholder when there are no messages.

ChatMessageList empty

No messages yet — say hello.

Props

PropTypeDefaultDescription
autoScrollbooleantrueAuto-stick to the bottom as content grows — but only while the user is already near the bottom, so scrolling up to read isn't interrupted.
childrenReactNodeThe message rows (e.g. <ChatMessage/> elements).
classNamestring
emptyReactNodeShown centered when there are no messages.
stickThresholdnumber120Distance (px) from the bottom still considered "at the bottom".

On this page