shadcn.io is not affiliated with official shadcn/ui
Components
Free
Bubble for React
A colored box for a short reply, with a side, a group, or a reaction. For React with Base UI, when the view is the thread and not a full message row.
Framework
UI library
One line of a conversation, in a colored box. It can sit to one side and take a reaction.
Use it when the view is just the thread, not a card around each line. When a line also needs an avatar or a time, use a Message. In React, Base UI has a frameless option so a long reply can use the full width.
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
<BubbleclassName="max-w-full min-w-0">
<BubbleContent>
I checked the registry output and removed the stale route.
</BubbleContent>
<BubbleReactions>
<span>👍</span>
</BubbleReactions>
</Bubble>
Demos
Variants
Every variant in one column: default, secondary, muted, tinted, outline, destructive, and ghost. A common split is tinted or default for the person's own messages and muted for the other side. Destructive is for a failure, and ghost drops the frame and the width cap so a long assistant reply can use the row. Pick the color for who is speaking, not as decoration.
Alignment
align defaults to start, the other person's side. end is the reader's own messages, and it follows writing direction, so a right-to-left layout still puts them on the correct side. Set it on each bubble. If the row also has an avatar and a timestamp, set the alignment on Message and let the bubble follow that.
Group
Consecutive messages from one person should not look like separate turns. BubbleGroup tightens the gap between them. Keep align on each bubble, not on the group, and start a new group when the sender changes. A reaction on the last bubble can use alignstart so it sits toward the thread instead of hanging off the outer corner.
Links and Buttons
Suggested replies can be the bubble itself. BubbleContent merges onto a button, so the whole colored box is the control and pressing it sends that text. How you merge the element depends on the base, and the clickable-bubble question in the FAQ names the prop. Stack the choices in BubbleGroup when they are a few answers under a prompt, not a link inside a sentence.
Reactions
BubbleReactions overlaps the edge of the bubble, on the bottom by default. Emoji can sit there, including a count when the list is long, and sidetop moves them above the text when the next message is close. The slot is not only emoji: a destructive bubble can hold a confirm button. Leave a gap so the next bubble does not cover the overlap.
Collapsible
A long note should not take over the thread. The bubble shows the first stretch of the text, then a show-more control inside a Collapsible reveals the rest, and show-less puts it back. Use this for a review, a log, or an assistant reply that runs long. Short chat stays visible, and the control lives in the bubble so you do not grow a second panel.
Tooltip
A read receipt is not part of the sentence. The check icon sits in BubbleReactions, and a Tooltip on that icon carries the time. Use this for a timestamp, a delivery state, or any one-line fact that would clutter the message. The tooltip leaves when focus does, so if the detail is several lines, put a popover in that same slot instead.
Popover
A failed command needs the error, but that text is not the line people should read first. The bubble says it failed, and an info button in BubbleReactions opens a Popover with the exit code and the missing file. Use this when the extra text is more than a tooltip and less than a dialog. That slot is already on the failed bubble, so it is the anchor.
Markdown
Assistant text is often more than one sentence: emphasis, code, a second paragraph. variantghost removes the frame and the width cap so that content can use the row, while the person's own short line stays a normal muted bubble. You render the markdown, and the bubble only supplies the container. Keep a frame when the text is a chat reply rather than a small document.
FAQ
What is the difference between Bubble and Message?
A Bubble is the colored box around the text. Message is the whole chat row around it: avatar, name, time and actions. Use a Bubble alone for simple chats, and a Message when each line carries that metadata, with a Bubble inside for the text.
How do I put sent chat messages on the right with Bubble?
Set align="end" on the Bubble, as in the Alignment demo; start is the default. Inside a Message, set the alignment on the message instead and the bubble follows it.
What Bubble variants are available in Base UI?
variant takes default, secondary, muted, tinted, outline, destructive or ghost. A common pairing is tinted for the reader's own messages and muted for replies; the Variants demo shows each one.
How do I group consecutive chat Bubbles from the same person?
Wrap them in BubbleGroup, as in the Group demo: it stacks them with a tighter gap than separate messages. Keep align on each Bubble, not on the group.
How do I make a Bubble clickable, such as a suggestion chip, in React?
Pass a button or a link to BubbleContent with render.
Add BubbleReactions inside the bubble: it overlaps the bubble's edge, on the bottom by default, as in the Reactions demo. Leave extra space between messages so the next bubble doesn't cover them.
How do I show a long AI reply with Markdown in a Bubble?
Use variant="ghost": it removes the frame and the 80% maximum width, so headings, lists and code can use the whole row, as in the Markdown demo. Keep framed bubbles for short messages.
How do I install the Bubble in React?
Run the command in the Installation section above: it adds bubble to your components/ui folder. React and Solid use the shadcn CLI, Vue uses shadcn-vue and Svelte uses shadcn-svelte, each after its one-time setup.
API Reference
Bubble
<div>data-slot="bubble"
PropType
align?"start" | "end"
The side of the conversation it sits on: start (theirs) or end * (yours).