MessageList
Auto-scrolling viewport for a chat stream. Pins to the bottom during streaming unless the user scrolls up to read history.
Installation
pnpm dlx @hex-core/cli add message-listAPI Reference
| Prop | Type | Default | Description |
|---|---|---|---|
autoScroll | boolean | true | Pin to bottom on content change (when the user is already near the bottom). |
childrenrequired | ReactNode | — | Sequence of <Message> elements. |
className | string | — | Additional CSS classes (e.g. height, padding). |
AI Guidance
When to use
Wrap a list of <Message> components when you want auto-scroll-on-stream behavior. Always set an explicit height (h-*, max-h-*) on the className so the viewport actually scrolls.
When not to use
Don't use for static FAQs or non-streaming layouts (use a normal Stack). Don't use as a generic scroll container — its bottom-pin behavior is opinionated.
Common mistakes
- Forgetting to set a height — the viewport won't scroll without `h-*` or `max-h-*`
- Disabling autoScroll while still expecting bottom-pin behavior — they're the same flag
- Putting non-Message children inside — a divider or banner breaks the role=log semantics
Accessibility
Renders as `role="log"` with `aria-live="polite"` and `aria-relevant="additions"` so assistive tech announces new turns. If you replace turns wholesale (e.g. on regenerate), pass `aria-relevant="additions removals"` as a prop — props spread onto the underlying div and override the default.
Related components
Token budget: 240
Verified against @hex-core/components@1.12.0