Bubble
Displays conversational content in a message bubble. Supports variants, alignment, grouping, reactions, and collapsible content.
Installation#
pnpm dlx shadcn@latest add @davinciui/bubbleUsage#
Bubble is intentionally scoped to the bubble surface. Place avatars, names, timestamps, metadata, and message-level actions outside it. Reactions overlap the bubble edge, so leave vertical space between rows. Tails live at the bottom corner — pair them with top-anchored reactions to avoid overlap.
Bubble
├── BubbleContent
└── BubbleReactions
BubbleGroup
├── Bubble
│ └── BubbleContent
└── Bubble
└── BubbleContentVariants#
Alignment#
Bubble Group#
Tails#
Links and Buttons#
Reactions#
Show More / Collapsible#
Tooltip#
Popover#
RTL#
Composition#
Use the following composition to build a Bubble:
BubbleGroup
└── Bubble
├── BubbleContent
└── BubbleReactionsAPI Reference#
| Prop | Type | Default |
|---|---|---|
variantVisual treatment. Ghost is unframed and full-width. | "default" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | "destructive" | "default" |
alignInline alignment of the bubble. Set on Bubble, not BubbleGroup. | "start" | "end" | "start" |
tailDirectional tail. Auto-skipped on ghost and mid-group rows. | boolean | false |
renderRender BubbleContent as a link, button, or custom element. | ReactElement | function | — |
sideBubble edge the reactions anchor to (BubbleReactions). | "top" | "bottom" | "bottom" |
align (reactions)Inline alignment of the reaction row (BubbleReactions). | "start" | "end" | "end" |
classNameAdditional classes on Bubble, BubbleContent, BubbleReactions, or BubbleGroup. | string | — |
Accessibility#
Bubble is presentational markup with no implicit role; BubbleContent can render as a button or link and then gains a focus-visible ring. Reactions remain unlabeled unless you add role='img' and aria-label, as the docs example does.
Motion#
Only color transitions are used for variant changes; bubbles, tails, grouping, and reactions do not animate. The component is static and does not reference prefers-reduced-motion.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

