Bubble
ConversationGroups conversational content and timestamps into visually distinct message bubbles.
Try it
Add to your project
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/bubble.jsonThe command includes the component’s shared dependencies. Your project keeps editable source files.
Include the complete example
This example also composes button, presence. Install its parts together:
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/button.json https://luv-jeri.github.io/cojeev-ui/r/bubble.json https://luv-jeri.github.io/cojeev-ui/r/presence.jsonUsing bubble
Compose BubbleRow, BubbleContent, and BubbleTime to present a message and its timing.
Use the available bubble variants to distinguish message presentation while keeping sender information in the content.
BubbleReaction composes Button for an explicitly labelled, controlled reaction; pass aria-label and aria-pressed with your count. BubbleTyping supplies a labelled, controlled typing indicator that becomes still under quiet preferences.
The conversation surface, timestamps and speech-tail cutout use theme-aware surface/text roles in both modes. Set --bubble-surface when providing a custom surrounding surface.
API
Compose the exported parts below. The prop types are read from the React source during the registry build.
Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.
BubbleProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | null | undefined | No |
size | "default" | null | undefined | No |
as | React.ElementType | No |
BubbleRowProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | "me" | null | undefined | No |
size | "default" | null | undefined | No |
as | React.ElementType | No |
BubbleContentProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | "me" | "tail" | null | undefined | No |
size | "default" | null | undefined | No |
as | React.ElementType | No |
BubbleGapProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | null | undefined | No |
size | "default" | null | undefined | No |
as | React.ElementType | No |
BubbleTimeProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | null | undefined | No |
size | "default" | null | undefined | No |
as | React.ElementType | No |
BubbleReactionProps
| Prop | Type | Required |
|---|---|---|
aria-labelDefines a string value that labels the current element. | string | undefined | Yes |
BubbleTypingProps
| Prop | Type | Required |
|---|---|---|
label | string | No |
Accessibility
Keep messages in a meaningful reading order and include sender and time text when needed; bubble styling does not create a live region.
States and appearance
For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.
Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.