Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Bubble

Displays conversational content in a message bubble. Supports variants, alignment, grouping, reactions, and collapsible content.

Hey there! what's up?
Hey! Want to see chat bubbles?
I can group messages, switch sides, and keep the whole thread easy to scan.
Sure. Hit me with your best demo.
Yes. You are reading a demo that is demoing itself. Very meta. Very on-brand.

Installation

pnpm add @heyramzi/ui

Usage

import * as Bubble from "@heyramzi/ui/shadcn/bubble";
<Bubble.Root align="end">
  <Bubble.Content>Hey there! What's up?</Bubble.Content>
</Bubble.Root>
<Bubble.Group>
  <Bubble.Root variant="muted">
    <Bubble.Content>Hey! Want to see chat bubbles?</Bubble.Content>
  </Bubble.Root>
  <Bubble.Root variant="muted">
    <Bubble.Content>I can group messages and switch sides.</Bubble.Content>
    <Bubble.Reactions role="img" aria-label="2 reactions">
      <span>+2</span>
    </Bubble.Reactions>
  </Bubble.Root>
</Bubble.Group>

API reference

Bubble.Root

variant "default" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | "destructive"
Default "default"
align "start" | "end"
Default "start"
ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
variant "default" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | "destructive" "default"
align "start" | "end" "start"
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Bubble.Content

child Snippet<[{ props: Record<string, unknown> }]>
ref bindable HTMLDivElement | null
Default null
class string
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
child Snippet<[{ props: Record<string, unknown> }]>
ref bindable HTMLDivElement | null null
class string
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Bubble.Group

ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Bubble.Reactions

side "top" | "bottom"
Default "bottom"
align "start" | "end"
Default "end"
ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
side "top" | "bottom" "bottom"
align "start" | "end" "end"
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements