Conversation
Preview

Scroll-aware chat conversation container with content, empty state, and scroll-to-bottom UI.

Overview

Conversation wraps the message feed area. It handles scroll positioning through use-stick-to-bottom, but it does not own messages or rendering.

Usage

import { Card, CardMeta } from "@tilt-legal/cubitt-components/card";
import {
  Conversation,
  ConversationContent,
  ConversationDownload,
  ConversationEmptyState,
  ConversationScrollButton,
  ConversationTimeline,
  Message,
  MessageContent,
  MessageResponse,
  messagesToMarkdown,
} from "@tilt-legal/cubitt-components/chat-elements";

Examples

Default

Timeline

Download

Empty

API Reference

Conversation

Scroll-aware conversation root powered by use-stick-to-bottom. Extends StickToBottom props.

PropTypeDefaultDescription
initialstring"smooth"Initial scroll behavior passed to StickToBottom.
resizestring"smooth"Resize scroll behavior passed to StickToBottom.
rolestring"log"ARIA role for the conversation region.
classNamestring-Additional CSS classes for the scroll root.

ConversationContent

Message stack inside Conversation. Extends StickToBottom.Content props.

PropTypeDefaultDescription
childrenReact.ReactNode-Conversation messages or custom content.
classNamestring-Additional CSS classes for the content.

ConversationTimeline

Left-side conversation turn index for jumping to user messages. Consumers own turn grouping and target ids; Cubitt owns the rail, hover preview, file indicator, active styling, and scroll affordance.

PropTypeDefaultDescription
itemsConversationTimelineItem[]-Prepared turn summaries and target ids. Required.
labelstring"Conversation timeline"Accessible label for the timeline navigation.
maxFilesnumber2Maximum file entities shown before the compact +N summary.
onNavigate(item: ConversationTimelineItem) => void-Called after a timeline item is selected.
classNamestring-Additional CSS classes for the positioned timeline navigation.

ConversationTimelineItem

Prepared display data for one user turn in ConversationTimeline.

FieldTypeDescription
idstringStable item id.
targetIdstringDOM id of the message or turn wrapper to scroll to.
messagestringUser message preview. Rendered as one small-size line.
responsestringOptional agent response preview. Rendered as small clamped text.
filesChatAttachmentFileData[]Optional files shown as compact entities and rail dots.
labelstringOptional accessible label for the timeline anchor.

ConversationEmptyState

Centered empty state for conversations. Extends all HTML div props.

PropTypeDefaultDescription
titlestring"No messages yet"Heading shown when children is not provided.
descriptionstring"Start a conversation to see messages here"Supporting text shown when children is not provided.
iconReact.ReactNode-Optional icon shown above the default title/description.
childrenReact.ReactNode-Custom empty-state content. Replaces title/description UI.
classNamestring-Additional CSS classes for the empty-state wrapper.

ConversationScrollButton

Scroll-to-bottom affordance for Conversation. Extends Button props and only renders when the conversation is not at the bottom.

PropTypeDefaultDescription
aria-labelstring"Scroll to bottom"Accessible label for the icon button.
onClickReact.MouseEventHandler<HTMLButtonElement>-Called after the internal scrollToBottom() handler.
classNamestring-Additional CSS classes for the positioned button.

ConversationDownload

Download button that converts messages to markdown and saves a .md file. Extends Button props except onClick.

PropTypeDefaultDescription
messagesUIMessage[]-Messages to serialize. Required.
filenamestring"conversation.md"Download filename.
formatMessage(message: UIMessage, index: number) => stringdefault formatterOptional formatter for each message before joining.
aria-labelstring"Download conversation"Accessible label for the icon button.
childrenReact.ReactNodedownload iconCustom button content.
classNamestring-Additional CSS classes for the positioned button.

messagesToMarkdown

Utility used by ConversationDownload.

ParameterTypeDefaultDescription
messagesUIMessage[]-Messages to serialize. Required.
formatMessage(message: UIMessage, index: number) => stringdefault formatterOptional formatter for each serialized message.

On this page