Skip to content

MessageScroller ​

Chat viewport

The scrolling transcript of a chat: it opens at the latest message, follows new ones while you're at the bottom, keeps your place while you read back, and loads history at the top.

Streamed, growing replies are followed too. Pair it with Message and Bubble for the rows and Marker for day separators and typing indicators.

Basic
Today
Megumi
おはよう。今日の予定は?
Tomoya
脚本の続き。第3話まで。
Tomoya
夜までには送る。
Megumi
了解。急がなくていいよ。
Scroll to top → loads 8 older lines without jumping. Scroll up, send → “↓ Latest” appears.
  • It is a named log (label), so new messages are announced politely. While a reply is streaming in, set aria-busy on that message so it's read once when it's done, not word by word.
  • The jump button appears when you've scrolled up; @reach-top asks for history and loadHistory(insert) keeps your place while it's added. Scrolling doesn't animate under reduced motion.

Usage ​

ts
import { BlessMessageScroller } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
thresholdnumber48px from bottom still counted as "at bottom"
topThresholdnumber80px from top that fires `reach-top` (history load)
initial"top" | "bottom""bottom"where to open: latest message or top of transcript
jumpLabelstring"Latest"
heightstring"400px"
labelstring"Messages"names the transcript

Events

NamePayloadDescription
reach-top[]
at-bottom[value: boolean]

Slots

NameScopeDescription
default—
jump—

Exposed

NameTypeDescription
scrollToBottom(behavior?: ScrollBehavior) => void
scrollTo(id: string, behavior?: ScrollBehavior) => void
loadHistory(insert: () => void | Promise<void>) => Promise<void>
atBottomboolean

Released under the MIT License. Character names and artwork belong to their owners.