Raft Design System

Components · Messages

ThreadPanel

The side panel for one thread — a header that names it, the original message, the replies and a composer, with no tabs.

StableAlso called Thread
import { ThreadPanel } from "@botiverse/raft-ui";

ThreadPanel shows the replies to one message beside the conversation it belongs to. It is not a narrower conversation panel: its header names the thread and where it is, the original message comes first, and it has no tabs.

thread-panel/thread-panel

When to use

SituationUse
The replies to one message, read beside the conversationThreadPanel
The conversation itselfConversationPanel
A profile beside the conversationA Panel with edge="attached"
A channel's tasks and filesSide sections in columns right of the conversation's panel (Page structure)
How a thread is reached from a messageMessageReplies

Anatomy

  • ThreadPanelRoot: the panel. It is a Panel with edge="attached", so it draws its own left seam.
  • ThreadPanelHeader: the header (44px with a mouse, 56px on a touch screen), built on PanelHeaderRoot.
    • ThreadPanelTitle: the title, "Thread", followed by ThreadPanelTitleMeta for where the thread is.
    • ThreadPanelActions: PanelAction buttons. The last ones are Expand and the × (Panel, Navigation); folded over the conversation, the header starts with Back and has no ×.
  • ThreadPanelContent: everything under the header.
    • ThreadPanelSearch, with ThreadPanelSearchTrailing and ThreadPanelSearchCount: an optional row for searching within the thread.
    • ThreadPanelOriginalMessage: the message the thread replies to, with a hairline under it. The hairline is a boundary: it sits a section step, 24px, under the message's last line, and the replies start a section step under it (ThreadPanelReplySummary) (Timeline rhythm).
    • ThreadPanelBody: the scrolling replies. ThreadPanelReplySummary and ThreadPanelReplyCount head the list of replies.
    • ThreadPanelFooter: the composer (Composer), with no space of its own above it, as in ConversationPanel.

Behavior

  • A thread and a profile can be open together: a profile opened from the thread sits beside it, and a profile opened from the conversation replaces it (Page structure).
  • Its width is in Spacing. When it sits beside the conversation and when it covers it is the product's rule (Raft Chat).
  • On a phone the thread is a pushed page: the same panel covers the conversation, with Back instead of the ×, and the tab bar stays hidden, as under the conversation (Responsive layout). On desktop, where the row can't hold it beside the conversation, it folds over the conversation, in the conversation's column, with Back at its header's start and no × (The channel's side columns).

Content

  • Title the panel "Thread".
  • Say in the header where the thread is and how many replies it has: "#launch-week · 3 replies".

Accessibility

  • ThreadPanelRoot renders a section. Name it with aria-label="Thread".
  • ThreadPanelTitle renders an h2.
  • Give every icon-only action an aria-label: "Search in thread", "Close thread".

Rules

  • Don't add tabs to a thread. It holds the original message, the replies and the composer, nothing else.
  • Leave 20px above the original message. The hover toolbar rides on a message's top edge (MessageItem); the original message is the first item in the scroll area, so with less room the toolbar is cut off and looks pinned under the header.
  • Separate the original message from the replies with a line-hairline, not a seam: both are content of the same panel.

API

ThreadPanelActions, ThreadPanelBody, ThreadPanelContent, ThreadPanelFooter, ThreadPanelHeader

PropTypeDefault
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

ThreadPanelOriginalMessage

Takes the attributes of its element.

ThreadPanelReplyCount, ThreadPanelReplySummary, ThreadPanelRoot, ThreadPanelSearch, ThreadPanelSearchCount, ThreadPanelSearchTrailing, ThreadPanelTitle, ThreadPanelTitleMeta

PropTypeDefault
renderAllows you to replace the component's HTML element with a different tag, or compose it with another component.ReactElement | ((props, state) => ReactElement)

Also takes the attributes of its element.

Changes

  • 0.105.1 · FixedPanel, PanelHeader, PanelFooter: inside a sheet (DrawerContent, or DialogSheetContent on a phone) they paint the sheet's layer-popover instead of their column's layer-canvas, so the sheet is one surface from the grab handle down; PanelHeader keeps its line-seam. ConversationPanelRoot, ConversationPanelFooter, ThreadPanelRoot and ThreadPanelFooter keep layer-canvas in a sheet, so a conversation or a thread in a sheet changes only in its head (PanelHeader, ThreadPanelHeader). Beside the page they are unchanged.
  • 0.5.1 · FixedRemoved the duplicate inset outline from Elegant dark ThreadPanelContent on large screens, leaving the header/content seam with a single visual owner.