hiip/ui

Components / Chat

Bubble

A chat bubble and what a message can carry: text, a link preview, a file, a sticker, a timestamp and reactions.

Install — needs @hiip registered in components.json

bunx shadcn@latest add @hiip/bubble

Or by URL, with the token in the query

bunx shadcn@latest add "https://ui.hiip.ai/r/bubble.json?token=$HIIP_REGISTRY_TOKEN"

Both need a token — set one up.

Anatomy

Import from components/ui/hiip-ui/bubble.

<BubbleGroup>
  <Bubble variant="received">
    <BubbleContent>
      {/* text, or one of the parts below */}
      <BubbleLink href="…" media={…} site="…" title="…" description="…" />
      <BubbleFile icon={…} name="…" meta="…" action={…} />
      <BubbleTime dateTime="…">…</BubbleTime>
    </BubbleContent>
    <BubbleReactions>👍</BubbleReactions>
  </Bubble>

  <Bubble align="end">
    <BubbleSticker>
      {/* a sticker or emoji, instead of BubbleContent */}
    </BubbleSticker>
  </Bubble>
</BubbleGroup>

Examples

Shipping address confirmed?
Yes — sending it over now.
👍
sample-document-with-a-long-filename.pdfPDF · 1004.3 KB
🎉

API Reference

Generated from the source. Props forwarded to the underlying element are not listed.

BubbleGroup

No props of its own.

Bubble

PropTypeDefault
align"start" | "end" | undefined"start"
variant"default" | "secondary" | "muted" | "sent" | "received" | "tinted" | "outline" | "ghost" | "destructive" | null | und…"default"

BubbleContent

PropTypeDefault
render

Allows you to replace the component's HTML element with a different tag, or compose it with another component.

ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, {}> | undefined

BubbleReactions

PropTypeDefault
align

`auto` follows the bubble's own side.

"start" | "end" | "auto" | undefined"auto"
side"top" | "bottom" | undefined"bottom"

BubbleTime

The in-bubble timestamp: the last message of a group carries its own time INSIDE the fill, rather than pushing another line under the thread.

No props of its own.

A link preview: an optional media plate, the raw URL, then the site's own metadata.

PropTypeDefault
descriptionReactNode
icon

The favicon or platform mark beside the title.

ReactNode
media

Full-bleed plate above the URL — a thumbnail, a player, a placeholder.

ReactNode
siteReactNode
titleReactNode

BubbleFile

An attachment row: icon tile, name and size, and whatever the caller wants the trailing control to be.

PropTypeDefault
namerequiredReactNode
actionReactNode
iconReactNode
meta

Type and size, e.g. `PDF · 1004.3 KB`.

ReactNode

BubbleSticker

A sticker or an emoji sent on its own.

No props of its own.

Type
registry:ui
npm packages
@base-ui/react class-variance-authority
Files written
  • components/ui/hiip-ui/bubble.tsx