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
Installation
npx shadcn@latest add https://fancyborders.vercel.app/r/bubble-frame.jsonThe 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.
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
import { BubbleFrame } from "@/components/bubble-frame";| Prop | Type | Default |
|---|---|---|
| side | "top" | "right" | "bottom" | "left"The edge the tail points out of. | "bottom" |
| at | number | `${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 |
| tailSize | numberHow far the tail sticks out, in pixels. | 10 |
| tailWidth | numberWidth of the tail where it joins the bubble, in pixels. | 16 |
| lean | numberHow far the tip leans along the edge, in pixels. Negative leans back. | 0 |
| radius | numberRadius of the corners, in pixels. | 14 |
Also accepts line, fill, color and every div attribute.