Chat / Messaging
聊天消息页
Aliases:聊天页聊天消息页私信页对话页消息窗口聊天界面发消息的页面会话列表
What is it
A page organized around conversations: a session list sorted by latest message, a chronological bubble thread and a composer for text and attachments.
Interactive playground
Try it. Make an informed choice.Loading lab…
✓ When to use
- One-to-one or small-group real-time communication
- Messages must keep context and support history lookup
- Ongoing support, community or team conversations
✕ When not to use
- One-way broadcasts — use a notification center or banner
- Content needs structured comparison — use a table or board
- One-off confirmations under a few messages — inline hints suffice
Variants
Split View
分栏会话
Conversation list plus thread, the desktop default
Focused Thread
单线程
Only the current conversation, common on mobile
Bubble Stream
气泡流
Group-style consecutive bubbles emphasizing speakers
Page structure
- 01
Conversation list
Avatar, name, last-message snippet and unread badge, ordered by latest message.
- 02
Thread header
Peer name, presence and more actions; returns to the list on mobile.
- 03
Message bubbles
Left/right distinguishes sender, with time and read state at the tail.
- 04
Date divider
Day dividers keep long threads from losing their sense of time.
- 05
Composer
Multi-line input plus attachments and send, with configurable Enter-to-send.
Implementation
flexgridoverflow-y: autooverflow-anchor: autoTwo columns via grid-cols-[280px_1fr], collapsing to a single stacked column on mobile. Keep the thread in chronological order and scroll to the end on send (scrollIntoView), anchoring scroll position when loading history. Cap bubbles near 72% width, auto-grow the textarea, and use optimistic sends that mark a retry state on failure.
Related concepts
A single-line bordered field for collecting text — the basic unit of every form. Placeholder hints the expected format, focus highlights the border to guide the eye, and failed validation switches to an error color with a hint. Prefix and suffix icons or a clear button can live inside, and the value is controlled state.
ComponentsContainsA small round or rounded-square image representing a user or organisation: photo, initials or an icon placeholder. Appears with names in navs, comments and member lists; can carry a status dot or stack several people together.
ComponentsContainsA small status marker attached to an element's corner or inline: a dot, a count or a short label. It signals unread counts, status (new, deprecated) or category; non-interactive and visually subordinate to its host element.
ComponentsContainsReplaces pagination with automatic loading: as the user scrolls to the bottom, the next page of content appends seamlessly, bridged by a loading indicator or sentinel element. It solves the broken browsing rhythm of hunting for a "next page" button — attention stays on the feed while long lists arrive in imperceptible chunks.
PatternsUses patternUpdate the interface immediately as if the operation will succeed while the real request runs in the background; settle on success, roll back to the original state with a notice on failure. It solves the "wait for the server on every action" problem — trading brief uncertainty for a zero-latency feel, ideal for frequent light actions like likes and bookmarks.
PatternsUses pattern