Components / Shapes

Speech Bubble

A rounded box with a tail on any edge. The border runs around the tail unbroken.

Shipped it.

The border goes round the tail.

Customize

Side
Position
28px
Tail size
10px
Tail width
16px
Lean
0px
Radius
14px

Installation

npx shadcn@latest add https://fancyborders.vercel.app/r/bubble-frame.json

The CLI copies the component into your project, adds anything it is built on, and writes its CSS into your global stylesheet. New to the CLI? See Installation.

Examples

A conversation

Tails on opposite sides, each a fixed distance from its own end.

Is the new border live?
Deployed a minute ago.
It goes all the way round the tail!

Good to know

  • The tail is drawn inside the frame's box, and the content is kept clear of it, so a bubble takes the room its box says it does.
  • A negative at counts from the far end of the edge, which keeps the tail a fixed distance from the right or the bottom.

API reference

BubbleFrame

tsx
import { BubbleFrame } from "@/components/bubble-frame";
PropTypeDefault
side"top" | "right" | "bottom" | "left"

The edge the tail points out of.

"bottom"
atnumber | `${number}%`

Where the tail sits along its edge: pixels from the left or top, pixels from the other end when negative, or a percentage.

28
tailSizenumber

How far the tail sticks out, in pixels.

10
tailWidthnumber

Width of the tail where it joins the bubble, in pixels.

16
leannumber

How far the tip leans along the edge, in pixels. Negative leans back.

0
radiusnumber

Radius of the corners, in pixels.

14

Also accepts line, fill, color and every div attribute.