MessageScroller
A scroll container for a conversation.
Import
import { MessageScroller } from "@tarve/core";Usage
import { Message, MessageScroller, Text } from "@tarve/core";
<MessageScroller height={360} gap={12} style={{ width: 420 }}>
{Array.from({ length: 20 }, (_, index) => (
<Message key={index} side={index % 2 ? "outgoing" : "incoming"}>
<Text>{index % 2 ? `Reply ${(index + 1) / 2}` : `Message ${index / 2 + 1}`}</Text>
</Message>
))}
</MessageScroller>Props
| Prop | Type | Default |
|---|---|---|
gap | number | 12 |
height | number | 360 |
onScroll | (offset: number, max: number, info: ScrollInfo) => void | — |
Common props
Shared by every component. See descriptions →
childrenclassclassNamehighlightidkeymotionFromonHighlightonPasteonPointerLeaveonPointerMoveonSizeonTransitionEndrovingGroupstyleTypes
interface ScrollInfo { source: ScrollSource }