Bubble
A composable conversation surface for messages, suggestions, and reactions.
Bubble presents short conversational content without owning the surrounding chat model. Keep avatars, sender names, timestamps, delivery state, and message-level actions in the parent interface.
Import
Section titled “Import”import { Bubble } from "@zentara-co/zenos-ui";Composition
Section titled “Composition”Compose Bubble.Content inside a root Bubble. Use Bubble.Group for consecutive messages from the same sender and Bubble.Reactions for a compact reaction or quick-action row.
<Bubble variant="secondary"> <Bubble.Content>The report is ready.</Bubble.Content> <Bubble.Reactions role="img" aria-label="One thumbs up reaction"> <span>👍</span> </Bubble.Reactions></Bubble>Reactions overlap the selected bubble edge. Leave enough space between conversation rows when reactions are present.
Actions
Section titled “Actions”Place any custom control inside Bubble.Actions to attach it to the logical end of the bubble. Actions default to visibility="hover": they appear on hover or keyboard focus on pointer devices and remain available on devices without hover. Use visibility="always" for persistent controls. The slot accepts dropdown menus, emoji-picker triggers, buttons, or any other element without owning its behavior.
Variants
Section titled “Variants”Use default for a strong current-user message, secondary for standard conversation content, muted for supporting information, tinted for quiet brand emphasis, outline for bordered rich content, ghost for unframed assistant output, and destructive for failed or unsafe results.
Custom variant
Section titled “Custom variant”Use any stable custom variant name with variantClassName to define a consumer-owned content treatment. The name is exposed through data-variant, while Zenos preserves Bubble layout, alignment, reactions, and native content behavior.
Alignment and RTL
Section titled “Alignment and RTL”Set align="start" or align="end" on each Bubble. Alignment and reaction placement use logical CSS edges, so the same composition mirrors automatically inside DirectionProvider direction="rtl" or an RTL document.
Interactive content
Section titled “Interactive content”Bubble.Content defaults to a div. Use as="button" or as="a" when the complete surface performs an action or navigates. Native props and refs follow the selected element, and Zenos supplies a visible keyboard focus ring.
No option selected.
Variants
defaultsecondarymutedtintedoutlineghostdestructive Bubble.Root Bubble.Group Bubble.Actions Bubble.Content Bubble.Reactions
API
| Prop | Type | Default | Description |
|---|---|---|---|
variant | BubbleVariant | custom string | default | Semantic surface treatment for the bubble content. |
variantClassName | string | — | Consumer-owned classes applied to Bubble.Content for a custom variant. |
align | start | end | start | Logical inline alignment of the bubble within its conversation row. |
Actions.visibility | hover | always | hover | Reveals custom end actions on hover and focus or keeps them visible. |
Content.as | ElementType | div | Renders content as a semantic element such as a button or link. |
Reactions.side | top | bottom | bottom | Bubble edge overlapped by the reaction row. |
Reactions.align | start | end | start | Logical position of reactions along the selected edge. |
native props | React.HTMLAttributes<HTMLElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Bubble is a presentational surface rather than a complete chat transcript. Put conversation semantics such as role="log", sender context, and live-region behavior on the surrounding interface. Give every interactive control inside Bubble.Actions an accessible name; hover-only actions are also revealed by keyboard focus. When reactions are decorative summaries, group them with role="img" and a descriptive aria-label; when they are actions, render labeled buttons instead. Destructive meaning must also be stated in text rather than communicated by color alone.