Prodular UI

AI

BubbleAI

A rounded container for short messages, used for what people write in a chat with an assistant.

npx prodular-ui add bubble

Variants

Muted is the default. The others are for messaging between people.

Muted, the default for what people write to the assistant.
Outline, for quoted or forwarded text.
Tinted, for the message you are replying to.
Default, a solid primary fill for messaging products.
This message could not be sent. Check your connection and try again.

Groups and reactions

Consecutive bubbles from one author sit in a BubbleGroup. BubbleContent can render as a button.

Daniel Ortiz11:02
PO 4471 is approved.
Copilot can release the Northbeam payment now.
2

Anatomy

<Bubble align="end">  <BubbleContent>What is our runway?</BubbleContent></Bubble>

Guidance

Use it when

  • For user messages in an assistant chat, and for every message in chat between people.
  • BubbleContent with render={<button />} for quick replies that send when pressed.

Avoid

  • Assistant answers. Render those with Response directly in the message.
  • The default primary fill in assistant chats. It competes with the answer.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Use the muted variant with align="end" for user messages in AI chat.
  • Keep bubbles under about 80% of the thread width. They do this by default.
  • Use destructive only for a message that failed to send, and offer a retry next to it.

API

Bubble

PropTypeDefaultDescription
variant"muted" | "default" | "secondary" | "tinted" | "outline" | "ghost" | "destructive""muted"Fill and border.
align"start" | "end""start"Side of the thread.

BubbleContent

PropTypeDefaultDescription
renderReactElementRender as a button or link for interactive bubbles.

BubbleReactions

PropTypeDefaultDescription
side / align"top" | "bottom", "start" | "end"Where reactions overlap the bubble.