LanternUI.Components.MessageScroller (LanternUI v0.8.2)

Copy Markdown View Source

Accessible, follow-aware transcript viewport for chat messages. No Fluxon equivalent.

Compose it with message_scroller_item/1 and message/1:

<.message_scroller id="conversation" label="Conversation" follow={true}>
  <.message_scroller_item id="message-1">
    <.message>Welcome.</.message>
  </.message_scroller_item>
</.message_scroller>

follow starts at the bottom and follows appended content while the user is at the bottom. peek controls the context left above a newly appended item marked with scroll_anchor. busy sets aria-busy on the log. The LanternMessageScroller hook observes appended nodes and streamed text patches, so the host updates content instead of issuing manual scroll commands. The viewport is labelled and the jump-to-latest button becomes keyboard reachable when the user scrolls away.

See the Chat Kit guide for the composed API and accessibility behavior.

Summary

Functions

message_scroller(assigns)

Attributes

  • id (:string) (required)
  • label (:string) - Defaults to "Messages".
  • follow (:boolean) - Follow the latest message and mount at the bottom. Defaults to true.
  • peek (:integer) - Defaults to 40.
  • busy (:boolean) - Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

message_scroller_item(assigns)

Attributes

  • id (:string) - Defaults to nil.
  • message_id (:string) - Defaults to nil.
  • scroll_anchor (:boolean) - Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)