RealTimeX
Sign inStart for free
RealTimeXWeb Package
IntroductionPrerequisitesInstallationProject setupQuick start
Package structureConfigurationComponentsHooksAPI integrationSocket events
OverviewReplace entire UIReplace componentsStyle with classNamesThemes & localePhone & video callingIn-call control barFeatures
Unread badgeRich-text messagesPins, stars & datesMessage threadsMentionsCanvas & draftsNotificationsAdmin permissionsServer refusalsSession & token refresh
Host app integrationTroubleshootingFAQVersion historyBest practicesSupport & contact
Web packageBuilt-in features

Pins, stars & jump to date

Built in, no props needed. Pins are shared with the conversation; stars are personal.

Pinned messages

WhereWhat the user sees
Message toolbarPin / Unpin
Pinned bar (under the header)The current pin - click to scroll to it, then to the next pin
Header options menuPinned messages (N) opens the PinnedMessagesDrawer list
Each row in the listClick to jump to the message; ⋯ → Unpin (only on pins you made)

The pinned bar works even when the message is older than what's loaded - the package fetches the messages around it, then highlights it. Pins per conversation are capped by maxPinnedMessagesPerConversation; past it the server refuses (PIN_LIMIT_REACHED) and the pin is undone - see When the server refuses.

Starred messages

WhereWhat the user sees
Message toolbarStar / Unstar (also on single attachments)
Header options menuStarred messages opens the StarredMessagesDrawer list
Each row in the listClick to jump to the message; ⋯ → Unstar
A starred thread replyClicking the row opens that thread in the Thread panel

Clicking a pinned or starred row (or Enter on it) scrolls to the message and highlights it, loading older messages first if needed; the list stays open beside the chat. Data comes from GET message/pinned-messages and GET message/starred-messages (API keys pinnedMessages / starredMessages for query params). Replace the lists with the PinnedMessagesDrawer / StarredMessagesDrawer slots.

Jump to date

Every date separator (“Today”, “Yesterday”, “Mon, 6 Oct”) is a button that opens a Slack-style Jump to… menu:

OptionGoes to
TodayFirst message today
YesterdayFirst message yesterday
Last weekFirst message on or after 7 days ago
Last monthFirst message on or after 1 month ago
The very beginningThe first message in the conversation
Jump to a specific dateA calendar - days before the conversation started, and future days, are disabled

If that day isn't loaded, the package loads older pages (20 messages each, at most 40 pages) until it reaches it, then scrolls to and highlights the day's first message. A day with no messages goes to the nearest day that has some (the earlier one on a tie). Days use the user's local time zone. Style the pill with classNames.dateDivider, or build your own control:

tsx
1import {2  ChatDateJumpMenu,3  resolveJumpDateBounds,4  resolveJumpPreset,5  clampJumpDate,6  type JumpToPreset,7} from "@realtimexsco/live-chat";8 9const { minDay, maxDay } = resolveJumpDateBounds(conversation.createdAt, oldestMessage?.timestamp);10 11<ChatDateJumpMenu12  label="Today"13  minDay={minDay}14  maxDay={maxDay}15  onJump={(preset: JumpToPreset, date?: Date) => {16    // preset: "today" | "yesterday" | "lastWeek" | "lastMonth" | "beginning" | "specific"17    // date is set when preset === "specific"18  }}19/>;

resolveJumpPreset("lastWeek") returns local midnight for that preset (ms), and clampJumpDate(date, minDay, maxDay) keeps a chosen day inside the conversation's range.

PreviousRich-text messagesNextMessage threads

On this page

Pinned messagesStarred messagesJump to date
Back to top