MessagePair
The unit of a conversation: one question and the answer it produced, presented together.
Install it:
npx shadcn add @ambientui/message-pairLive
How do I persist composer drafts across threads?
Answer the question to watch the pair complete.
Behavior
- ·Pairing is what makes a transcript readable — an undifferentiated list of messages is a log, not a conversation.
- ·Two presentations, one anatomy: BUBBLE gives each side a surface (the question on the accent wash, the answer on an inset card); FLAT sets both directly on the transcript, separated by alignment and tone alone.
- ·The answer streams in place: settled text in the foreground, the last words warm in the ambient accent, and the leading edge blurred behind a fading mask — a stream reads as writing rather than as text appearing.
- ·NO AUTHOR MARK on the answer: the identity lives in the shell — the orb, the live border, the surface's own brand mark — so a message never signs itself. Alignment alone says who is speaking.
- ·onSettled fires when the answer finishes, which is what returns the ambient layer (orb, borders, field) to rest.
When to use
- ·Any assistant exchange in a conversation surface — panel, dock, or the spotlight's AI Overview.
- ·When the question needs to stay visible next to its answer, which is nearly always.
When not to
- ·A one-shot answer with no question worth showing — render the answer alone.
- ·System notices or confirmations; those are toasts or an error object.