A
Alice3:12 PM
Hey team — shipping the new thread view today 🚀
A conversation thread that renders messages with avatars, relative timestamps, reactions, reply indicators, and attachments. Backed by the headless @refraction-ui/thread-view core.
A thread with a reaction, a nested reply count, an edited message, and an attachment.
pnpm add @refraction-ui/react-thread-viewimport { ThreadView, type MessageData } from '@refraction-ui/react'
const messages: MessageData[] = [
{
id: 'm1',
author: { id: 'u1', name: 'Alice' },
content: 'Shipping the new thread view today 🚀',
timestamp: new Date(),
reactions: [{ emoji: '🚀', count: 3, userReacted: true }],
},
]
export function Conversation() {
return (
<ThreadView
messages={messages}
currentUserId="u1"
onReact={(id, emoji) => toggleReaction(id, emoji)}
onReply={(id, content) => sendReply(id, content)}
/>
)
}| Prop | Type | Default | Description |
|---|---|---|---|
messages | MessageData[] | -- | The thread to render. Each message carries an author, content, timestamp, and optional reactions, replies, attachments, and edited flag. |
currentUserId | string | -- | Id of the viewing user, used for ARIA labelling and ownership cues. |
onReply | (messageId: string, content: string) => void | -- | Called when the user submits a reply to a message. |
onReact | (messageId: string, emoji: string) => void | -- | Called when the user toggles a reaction on a message. |
className | string | -- | Additional CSS classes to apply to the thread container. |