GodUI

Conversation Thread

A streaming AI chat surface — messages spring in, tokens reveal with a blinking caret, hover actions fade in, and the view auto-sticks to the latest message.

You
How do I center a div in 2026?
GodUI
Use a grid parent with `place-items-center` — it centers on both axes in a single declaration.

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/conversation-thread.json"

ConversationThread owns the scroll container: it stays pinned to the newest message until you scroll up, then reveals a Jump to latest pill. Each ConversationMessage springs in, aligns by role, and reveals hover actions. StreamingText reveals a string token-by-token and honors reduced motion.

Usage

tsx
 
import {
  ConversationThread,
  ConversationMessage,
  StreamingText,
} from "@/components/godui/conversation-thread";
tsx
 
<ConversationThread variant="bubbles">
  <ConversationMessage role="user" name="You">
    Hi
  </ConversationMessage>
  <ConversationMessage
    role="assistant"
    name="GodUI"
    actions={[{ label: "Copy", icon: <CopyIcon />, onClick: copy }]}
  >
    Hello!
  </ConversationMessage>
</ConversationThread>

Props

ConversationThread

PropTypeDefaultDescription
variant"bubbles" | "document" | "compact""bubbles"Layout style.
autoScrollbooleantrueStick to the newest message when at bottom.

ConversationMessage

PropTypeDefaultDescription
role"user" | "assistant" | "system"Determines alignment and tint.
namestringAuthor label.
avatarReactNodeAvatar node.
timestampstringTime label.
actionsMessageAction[]Hover actions (copy, regenerate, …).
streamingbooleanfalseShows a blinking caret while streaming.

StreamingText

PropTypeDefaultDescription
textstringFull text to reveal.
chunknumber2Characters revealed per tick.
speednumber24Milliseconds between ticks.
onDone() => voidFired when the full text is shown.

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub