Skip to content
Ballpoint

Bubble

A message's frame: a rounded box drawn round what is said, shaded solid, hatched, washed or just pencilled, in the ink or the red pen.

From shadcn/ui
Built on Base UI Use Render
How can I help you today?
Draw me a ballpoint pen.
Here is one.
I hatched the shadow lightly.

Installation

pnpm dlx shadcn@latest add @ballpoint/bubble

Usage

tsx
import { Bubble, BubbleContent } from "@/components/ui/bubble"

<Bubble variant="secondary">
  <BubbleContent>How can I help you today?</BubbleContent>
</Bubble>

Examples

Variants

Seven ways to colour it in, from the solid bubble for the current user to unframed text.

A default bubble.
A secondary bubble.
A muted bubble.
A tinted bubble.
A outline bubble.
A ghost bubble.
That page didn't save.

Reactions

Small pencilled chips pinned to the edge, on the bottom or the top.

I checked the registry output and removed the stale route.
👍2
Lovely, thank you.
❤️

Render the surface as another element with `render`.

API reference

Bubble variant
default "default"
"default" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | "destructive"

Solid ink, hatched, lightly hatched, washed, pencilled, unframed, or red pen.

Bubble align
default "start"
"start" | "end"

Which edge of the conversation it sits against.

BubbleContent render
ReactElement

Render the surface as a link or a button.

BubbleReactions side / align
default "bottom" / "end"
"top" | "bottom" / "start" | "end"

Where on the edge the reactions sit.

BubbleGroup
div

Groups consecutive bubbles from one sender.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Use Render.

Pen settings

The drawing also takes draw, roughness, passes, radius, corners, weight and speed, as props or from the nearest InkProvider. What each one does.