Bubble
The message surface for chat interfaces, with variants and reactions.
Hey, did you ship the new docs page?
The nav check is failing on my branch.
Just pushed the fix, pull and rerun it.
2
Installation
pnpm dlx nachui add bubbleAnatomy
Bubble is deliberately scoped to the surface itself. Sender name, timestamps, avatars and actions belong to Message, which composes bubbles into a full conversation row.
Composition
Use the following composition to build a
Bubble:Variants
Seven variants cover both sides of a conversation and the states around it:
default for the current user, secondary and muted for the other side, tinted for a subtle primary wash, outline and ghost for quiet content, and destructive for errors.Default, for the current user.
Secondary, for the other side.
Muted, for supporting content.
Tinted, a subtle primary wash.
Outline, framed but quiet.
Ghost, no frame at all.
Destructive, something went wrong.
API Reference
Bubble
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'secondary' | 'muted' | 'tinted' | 'outline' | 'ghost' | 'destructive' | 'default' | Visual treatment of the surface |
align | 'start' | 'end' | 'start' | Which side the bubble hugs |
className | string | - | Additional CSS classes |
Bubble.Content
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | Merge styles into the child element, e.g. a link |
className | string | - | Additional CSS classes |
Bubble.Reactions
| Prop | Type | Default | Description |
|---|---|---|---|
side | 'top' | 'bottom' | 'bottom' | Edge the pill overlaps |
align | 'start' | 'end' | 'end' | Horizontal anchor along that edge |
className | string | - | Additional CSS classes |
Bubble.Group
| Prop | Type | Default | Description |
|---|---|---|---|
align | 'start' | 'end' | 'start' | Alignment of the stacked bubbles |
className | string | - | Additional CSS classes |
Found something to improve?
Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.