Layout for one chat turn: avatar, header, bubbles and footer, mirrored for the sender.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
Code
"use client";
import { Avatar, AvatarFallback } from "@/registry/ui/avatar";
import { Bubble, BubbleContent } from "@/registry/ui/bubble";
import { Marker, MarkerContent } from "@/registry/ui/marker";
import { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader } from "@/registry/ui/message";
export default function MessageDemo() {
return (
<MessageGroup style={{ width: "min(460px, 100%)", gap: 16 }}>
<Marker variant="separator">
<MarkerContent>Today</MarkerContent>
</Marker>
<Message>
<MessageAvatar>
<Avatar>
<AvatarFallback>AL</AvatarFallback>
</Avatar>
</MessageAvatar>
<MessageContent>
<MessageHeader>Ada</MessageHeader>
<Bubble variant="muted">
<BubbleContent>Shipped the overlays batch. Want a look?</BubbleContent>
</Bubble>
</MessageContent>
</Message>
<Message align="end">
<MessageContent>
<Bubble>
<BubbleContent>On it. The scrim reads much calmer now.</BubbleContent>
</Bubble>
<MessageFooter>Read 09:41</MessageFooter>
</MessageContent>
</Message>
</MessageGroup>
);
}
































