Docs / Themes and bubbles / Shaped bubbles
Shaped bubbles
A bubble style can be a plain bubble with a character sitting on its corners, or it can follow any outline you draw, such as a snake or a speech balloon with a bite out of it. For a drawn outline, Isolink lays the words, photos and cards of each message inside the shape line by line, and checks the result before showing it. If something can't fit, the bubble falls back to a simpler shape, so nothing gets cut off.
What shaped bubbles are
EveryoneMost bubbles are rounded rectangles. The 15 Isolink characters, from Axolotl to Starry Jelly, are framed bubbles, free in Theme Studio's Browse tab from the Isolink store: an ordinary rounded body with a character drawn on its corners and edges, and a repeating background to match. Your words sit in the body as usual.



A shaped bubble goes further and follows a drawn outline, such as a character's body, and the message fills that shape. The earlier built-in characters (Snake, Capybara, Cat, Bee, Train and Hotdog dog) were shaped bubbles. They're no longer offered in Theme Studio, but chats that already wear one keep it, and the examples on this page still use them.
You can start your own bubble from a copy of any of them in Theme Studio, or design a new one. The rest of this page explains how a message fits its bubble, first for everyone and designers, then for developers writing the JSON.
How a message is laid out
EveryoneIsolink doesn't put a shaped bubble's content in one rectangle. It places it piece by piece through the shape:
- Blocks first. The sender's name, the message being replied to, a photo or video, then any card, each as a rectangle in the widest free part of the shape. A photo or video is never narrower than 120 dp and cards and replies never narrower than 160 dp, and each keeps its own proportions.
- Then the words, line by line. Each line sits in the widest span that is free across its whole height. Lines beside a head or a paw are shorter, and lines with nothing beside them take the full width. Bold, links and other formatting flow with the lines.
- Then the time. It goes after the last line's words when there is room, or on its own line below. Delivery ticks sit outside the bubble.
The bubble's height is worked out, not guessed. It grows until everything fits, then narrows to the smallest height that still fits. Short messages stay short, and long ones grow up through the character's body, keeping the head and feet the same size.


A very long message (over 800 characters or 12 or more lines), which you can unfold, and a message holding a code block stay as one rectangle inside the shape.

Nothing is cut off
EveryoneBefore a shaped bubble is shown, every line, block and the time is checked against the final shape, and against each other so that nothing overlaps. If the check fails, Isolink steps back:
- First it puts the content in the largest rectangle that fits inside the shape, and checks that.
- If that fails too, the bubble is drawn as an ordinary rounded bubble in the style's colour with a thin outline, and the decorations are put away.
Either way every word, link, photo and button is shown in full and can be tapped. Content is never clipped to make it fit.

Reactions
EveryoneOn a shaped bubble, reactions can hang from a point the designer chose, such as under the inner corner, clear of the words. Wherever the reactions reach past the bubble, Isolink keeps that much room around it, so they are never cut off and never cover the next message. On a bubble without such a point, reactions sit in their usual place under the bubble.

Cards
EveryoneCards inside a styled bubble (code blocks, link previews, files, polls, lists, places and contacts) stay rectangular so what they hold is easy to read. Each gets a header that wears the theme over a solid panel. The header is at least 36 dp tall so its buttons keep a full tap size, and its words are shaded if they would not read at 4.5 to 1. Code keeps its own colours on its own panel. In the fallback bubble, cards keep their themed header.

cards settings (see Themed card headers).Right-to-left text
EveryoneHebrew, Arabic and other right-to-left text flows through the shape the same way. Each line sits at the right of its span, and the whole message takes its direction from its first letter that has one. Emoji, accented letters and other combined characters are never split across lines.


Selecting, copying and screen readers all work on the original message. Copying gives exactly the characters that were sent, and a screen reader reads the whole message once, in order.
Their bubbles
EveryoneYour bubbles sit on the right and theirs on the left, so a character usually faces the other way on their side. A style made of frame pieces is mirrored as a whole on their bubbles: the outline, the pieces, the areas kept clear of text and the reactions point all flip together, and the words stay readable. Isolink's characters work this way. A character drawn as one picture needs separately drawn art for their side, as the earlier shaped characters had.


Reduced motion and loading
EveryoneThe layout never depends on animation. Space kept clear around a moving decoration covers every position it moves through, so the words never jump. When you ask your device for less motion, the bubble shows its still image and the text sits exactly where it would otherwise.

Layout guides
DesignersIn the bubble designer, the Layout guides button (the grid icon) draws how a message was laid out: the free area words may use in green, areas kept clear in red, each line in blue, the time in amber and blocks such as photos in purple. Turn it on while you adjust a shape. Every bubble should show its content flowing, not falling back to the plain rectangle.


Framed characters
DevelopersA framed character is a frame of pieces with no clip: four corner pictures that keep their size and four edge pictures that stretch between them, drawn round an ordinary body. With flip: true and "mirror": true on their part, one style serves both sides. This is the Red Panda's bubble, with the pictures left out:

"parts": {
"mine": {"ref": "red-panda"},
"theirs": {"ref": "red-panda", "mirror": true}
},
"bubbles": {
"red-panda": {
"v": 2, "id": "red-panda", "name": "Red Panda", "flip": true,
"body": {"fill": "colour", "c": 4294898136},
"border": {"fill": "none", "w": 0, "r": 19},
"shape": {"corners": [19, 19, 19, 19], "tail": {"at": "none"}},
"frame": {
"padding": [0, 0, 0, 0],
"bleed": [0.15, 9.6, 1.72, 0.9],
"bodyRect": [2, 2, 2, 2],
"radius": [8, 8, 8, 8],
"pieces": {
"topLeft": {"width": 28, "height": 23.5, "img": "…"},
"topRight": {"width": 28, "height": 23.5, "img": "…"},
"bottomLeft": {"width": 28, "height": 15, "img": "…"},
"bottomRight": {"width": 28, "height": 15, "img": "…"},
"top": {"height": 12.5, "fit": "stretch", "img": "…"},
"bottom": {"height": 4, "fit": "stretch", "img": "…"},
"left": {"width": 3, "fit": "stretch", "img": "…"},
"right": {"width": 4.5, "fit": "stretch", "img": "…"}
}
},
"text": {"c": 4283906087, "readable": false, "links": "text"},
"media": {"fit": "plate", "inset": 8},
"emoji": {"bare": true, "max": 3}
}
}
The pieces are drawn at twice their size in dp, so a 28 by 23.5 dp corner is a 56 by 47 px PNG. bleed lets the art reach past the body, here 9.6 dp above it for the panda's ears. Copying a character in Theme Studio gives you a pack with these bubbles and the matching background, ready to change.
Silhouettes
DevelopersA style counts as shaped, and flows its content, when it has any one of these:
- a frame of
pieceswith aclip(a vector path or an alpha mask); - a picture frame with a
mask,under: "content"andfill: "stretch", as the earlier built-in characters have; - a
flowblock.
Any other style lays out as an ordinary rounded rectangle. These fields are described in full in sections 4.5, 4.5.1, 4.12, 4.13 and 4.14 of the theme pack spec.
Frame pieces
A frame of pieces is up to eight pictures: four corners (topLeft, topRight, bottomLeft, bottomRight) that keep a fixed size in dp, and four edges (top, left, right, bottom) that stretch or repeat between them. Corners need width and height, top and bottom edges height, side edges width, each 0.5 to 128 dp. Edges take fit (stretch or repeat), and any piece an overlap of 0 to 8 dp. The frame also takes padding, bleed and bodyRect (each [left, top, right, bottom], 0 to 128 dp), radius, minSize ([width, height], 0 to 512 dp), a compact set of pieces for short bubbles, and the silhouette clip.
The silhouette (clip)
clip gives the body its real shape. Draw it on an authoring canvas. The canvas is cut in nine by slice and laid over the frame box with the same geometry as the pieces, so their outlines stay aligned:
- The four corner regions keep their size in dp, so shoulders, a muzzle or a notch are never stretched.
- The top and bottom regions stretch across, the side regions stretch down, and the middle stretches both ways.
scaleis canvas units per dp. Withscale: 2, a slice of 48 units is a fixed region 24 dp deep.
| Field | Rule | Meaning |
|---|---|---|
path | Up to 8192 characters; exactly one of path and img | An SVG path d using M, L, H, V, C, S, Q, T and Z, absolute or relative. No arcs (A): draw them as cubic curves. It must start with a move, with at most 256 segments and 4 subpaths. |
size | [width, height], each above 0 and at most 2048; required with path | The path's canvas, in path units. |
rule | nonzero (default) or evenodd; only with path | How subpaths fill. Holes are outside the shape for every purpose. |
img | A PNG, at most 512 px a side | The silhouette as an alpha mask. Alpha of 50% or more is inside. Its canvas is the PNG's own size. |
slice | [left, top, right, bottom]; whole pixels 0 to 512 for a mask, any number 0 to 2048 for a path | The fixed regions. Left plus right must be less than the canvas width, and top plus bottom less than its height. Default: a third of each side. |
scale | 1 to 4, default 2 | Canvas units per dp. |
- The silhouette covers the frame box: the bubble's box grown by
bleed. - The body fill, the readability shade, the content and taps are all limited to it.
- With a path, the style's
borderis drawn along the path. With a mask, draw the outline in the pieces and leaveborder.fillasnone. - Pieces and front layers still draw over the whole frame box, so art can reach outside the shape.
- Prefer a path. It needs no decoding, the border follows it, and it maps exactly across the stretching regions.
compactcan carry its ownclip. Without one it uses the main frame's.
A complete shaped style
DevelopersPebble is a speech bubble with a bite out of its top right corner, where a leaf sprig sits. It uses one frame piece (the sprig), a vector silhouette, an exclusion round the sprig, a reactions point and a themed card header. The notch is inside the top right fixed region, so it keeps its size however long the message is. One style serves both sides: with flip: true their bubbles are mirrored.


{
"v": 2,
"id": "pebble_pack",
"name": "Pebble",
"parts": {"mine": {"ref": "pebble"}},
"bubbles": {
"pebble": {
"id": "pebble",
"name": "Pebble",
"v": 2,
"body": {"fill": "colour", "c": 4293128935},
"border": {"fill": "colour", "c": 4281236815, "w": 2, "line": "solid"},
"text": {"c": 4279710239, "readable": true},
"frame": {
"pieces": {"topRight": {"img": "sprig", "width": 24, "height": 24}},
"padding": [4, 2, 6, 8],
"minSize": [120, 56],
"clip": {
"path": "M24 0 H174 C181 0 186 5 186 12 C186 36 204 54 228 54 C235 54 240 59 240 66 V118 C240 128 236 134 228 140 L238 160 L206 150 H24 C11 150 0 139 0 126 V24 C0 11 11 0 24 0 Z",
"size": [240, 160],
"slice": [48, 64, 64, 40],
"scale": 2,
"rule": "nonzero"
}
},
"flow": {
"clearance": 4,
"minLineWidth": 48,
"exclusions": [{"shape": "ellipse", "on": "canvas", "rect": [188, 0, 52, 52]}]
},
"points": {"reactions": {"at": [0.2, 1], "chip": [0, 10]}},
"cards": {
"header": {"fill": "colour", "c": 4281236815, "text": 4294967295},
"border": "style",
"radius": 10
},
"flip": true
}
},
"assets": {
"sprig": {
"png": "iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEUAAAAaYDtMr24NaSglckY3jlgQbFgbYTsaYDoA/wAcZkASnlHGeJYSAAAADHRSTlMA8f0O/v0MXKEBWQf+zaSIAAACHUlEQVR42s1Tz2sTYRB9uxM3aaolXxKzsRAja+Mhh/ZLIpooSleM9GYbcqkoBiKlIEqCYMRTFvoHBEHUW/4H0aP04LGtqRHixcbowQpNmx8lhbRbPLRlNzEI4sU5vjfzvfnezAD/FhT5A0dAqh9MXYiAAyDel2zVWGY4l8ulqGDGh5CNJx1Zxpg3A5BBWOlzZ3T9w2Tz+NnFZEk0iMCrcRE744Bei53jgkmCjYRL20FnQzhRbm2YKt7s0yYeflxZc7R8Id3Q4PWhpt9zbGLJ+mOr7axaDMLRpFKnqu61OPSr74ynhl1lXdytFKV7y8s3nnaNAiyMKWomxDjm7iNm4NITlkjKxGSKmH9HlHWrblaMsgzHXNpkX9SdCKiPSJOlHvsk0q4p8RnMs3y619joSWVGmZpn7PHRMA4s4erqd9+3TlfdKD2/ZSaIjShrE+FnV0rh91MoAoAFACRBEPdp0QORr8Tetg9yAQDieWf1dL292bD7P23fXgIAEQB0lL+EK6PTOFNr7U5aze1qqjdjYzm3EoiPeQrGU/rO5VMvH1R+3tyrN0O117ppD0AvmItIu55IukztgoOvfvUDl+QC7jaKZpW0JhMI0kVOvW7ZWB6AhP4F5VkvBwDpaK0PNSTBLtZ7Mg9n3g3ChwGEFJmWSgOvwsbyfBDOs17qgwQAIItdbOgDNFJB+O4MlFiQ6bdbBAB0ZrfW/+6+Jfxf8Qtf647bYZtDkQAAAABJRU5ErkJggg==",
"w": 48,
"h": 48
}
}
}
How it fits together:
- The canvas is 240 by 160 units at
scale: 2, so the bubble's natural shape is 120 by 80 dp.slice: [48, 64, 64, 40]keeps the left 24 dp, the top 32 dp, the right 32 dp and the bottom 20 dp fixed. The notch (top right) and the tail (bottom right) sit in fixed corners. - The sprig is a 24 dp
topRightpiece. Corner pieces draw over the frame box, so it sits in the notch. - The ellipse exclusion is measured on the canvas (
on: "canvas"), so it stays on the sprig as the bubble stretches. Withclearance: 4, text keeps 4 dp from the outline and from the exclusion. - The body has a plain colour, so cards get a solid green header with white words.
flow, cards and reaction chip offsets need an app that includes shaped bubbles. Older apps refuse a style that uses them, with a message such as unknown frame field clip.Text flow (flow)
Developers
A flow block sets how content keeps clear of the silhouette and the art. It is optional: any shaped style flows its content, and without a flow block the clearance is 0 and the narrowest line is 48 dp.
"flow": {"clearance": 4, "minLineWidth": 48}
| Field | Rule | Meaning |
|---|---|---|
clearance | 0 to 24 dp, default 4 | Kept free inside the silhouette's edge and round every exclusion. |
minLineWidth | 24 to 240 dp, default 48 | No line is laid narrower. A narrower span is skipped and the line moves down. |
exclusions | At most 8 | Areas content keeps out of, on top of the silhouette. |
The content area starts as the body box minus the style's padding (the frame's padding, plus room for any border or speech tail) and a small inner margin of 10 dp at the sides and 6 dp at the top and bottom. Within that area, each line takes the widest span that is inside the silhouette (shrunk by the clearance) and outside every exclusion (grown by the clearance) across the line's whole height.
Exclusions
DevelopersAdd an exclusion for any art that reaches into the content area, such as a head drawn over the body or a paw.
"exclusions": [
// shares of a layer's box: follows the layer and its animation
{"shape": "ellipse", "on": "layer", "layer": "head", "rect": [0, 0, 1, 1]},
// shares of the body rectangle, as your own bubble faces
{"shape": "rect", "rect": [0.75, 0, 0.25, 0.3]},
// a path on the frame's canvas, laid over rect (canvas units)
{"shape": "path", "on": "canvas", "rect": [150, 0, 80, 60],
"path": "M0 60 C10 0 70 0 80 60 Z", "size": [80, 60]}
]
| Field | Rule | Meaning |
|---|---|---|
shape | rect (default), ellipse, path | Its outline. An ellipse is held by a polygon round its outside. |
on | body (default), canvas, layer | What rect is measured on: shares of the body rectangle; units of the frame's canvas (mapped as the frame stretches, so it stays on the art); or shares of a layer's box, following the layer. |
layer | A layer id, only with on: "layer" | The layer it follows. |
rect | [x, y, w, h], required, w and h above 0 | Where it is: shares from -1 to 2, or canvas units within ±2048. |
path, size | Only with shape: "path"; at most 2048 characters, 64 segments and one subpath; size each side above 0 and at most 2048 | An outline drawn on a canvas of size, laid over rect. |
envelope | 0 to 32 dp, optional | How far it grows to cover motion. Left out on a layer exclusion, it is worked out from every pose of the layer's bob, scale, rotate, swing and spin animations, and those of the layer it rides. |
- An
on: "canvas"exclusion needs a frame with a canvas: a picture frame, or pieces with aclip. - Shares are measured as your own bubble faces. Exclusions mirror with the art on their bubbles.
- Use
canvasfor art that is part of the frame, andlayerfor a decoration layer.
Picture frames with a mask
DevelopersThe earlier built-in characters each use one nine-sliced picture frame with an alpha mask, drawn separately for each side. With under: "content" and fill: "stretch", the body fill is painted through the mask and the content flows inside it. This is the Cat's frame (asset ids are the bundled pictures; bleed values rounded):

"frame": {
"img": "a34192b94b0e0ae74c6f1",
"mask": {"img": "a754755e5bed16ce9340b"},
"slice": [77, 11, 115, 112],
"padding": [54, 5, 72, 1],
"bleed": [0, 0, 0, 2.34],
"fit": "bottom",
"fill": "stretch",
"under": "content",
"compact": {
"img": "afdb26aac669354735e61",
"mask": {"img": "a30ffbe5be34e2407f405"},
"slice": [77, 36, 115, 68],
"bleed": [0, 11.98, 0, 2.34],
"maxHeight": 50
}
},
"flow": {"clearance": 4, "minLineWidth": 48},
"points": {"reactions": {"at": [0.25, 1], "chip": [0, 12]}}
A picture frame's slice is in PNG pixels, drawn at half size. The mask must be exactly the frame picture's size. The compact art is used when the bubble is at most maxHeight dp tall. Picture frames are not mirrored by flip: give their side its own style with mirrored pictures and swapped left and right slices, padding and bleed, and name it in parts.theirs.
Reaction chip offsets
DevelopersWhen a style has a point named reactions (or else head), a message's reaction chips are centred on it, moved by the point's chip offset.
"points": {"reactions": {"at": [0.25, 1], "chip": [0, 12]}}
| Field | Rule | Meaning |
|---|---|---|
at | [x, y], each -1 to 2, default [0.5, 0.5] | A share of the body rectangle (or of a layer's box, with layer), from its top left, as your own bubble faces. |
layer | A layer id, optional | Put the point on that layer's box. |
chip | [dx, dy], each -48 to 48 dp, default [0, 0] | How far the chips sit from the point, mirrored on their bubbles. |
[0.25, 1] with a chip of [0, 12] hangs the chips under the inner side of the bubble, clear of the words. Particle layers on the same point keep their own anchor.offset, so chips and particles move independently. The room the chips need past the bubble is taken from the width the bubble may have.
Themed card headers (cards)
Developers
Without a cards block, cards still take the theme, with every field at its default.
"cards": {
"header": {"fill": "body", "text": 4294967295, "img": "<paw asset id>", "size": 20},
"border": "style",
"radius": 10,
"panel": 4280884240
}
| Field | Rule | Meaning |
|---|---|---|
header.fill | body (default), colour, gradient | body repeats the style's own body in the header. colour needs header.c; gradient needs header.stops (2 to 6) and takes header.angle (0 to 360). |
header.text | Colour, optional | The header's words and icons. Default: the style's text colour. |
header.img, header.size | PNG at most 128 px a side; size 12 to 32 dp, default 20 | A small picture at the header's end, drawn size dp tall. It counts toward the style's picture budget. |
border | style (default) or none | style draws a 1 dp outline in the style's border colour, or the text colour at 30% when the border isn't a plain colour. |
radius | 0 to 24 dp, default 10 | The card's corners. |
panel | Colour, optional | The card body. Used only when the style's text colour reads on it at 4.5 to 1. Otherwise, and by default, a solid near-white or near-black panel lightly tinted with the body colour. |
Give a colour or gradient header when the body texture is too busy behind small words.
Verification and tolerance
DevelopersLayout is bounded and checked:
- The solver tries at most 10 heights. It starts from the content laid out as a rectangle, grows until everything fits, then narrows by bisection. Each try measures the shape at that height, so art anchored to the bottom moves with it. Layout never depends on paint, animation or earlier frames, so it always settles.
- Every block, line and the time is then checked against the final region and against each other. Only a bubble that passes is shown flowing.
- If no height passes, the content goes in the largest checked rectangle inside the silhouette, growing the bubble at most four times to find one. If that fails too, the bubble is drawn as a plain rectangle with its layers hidden, and taps cover the whole rectangle.
Distances are in rendered dp:
| Case | Rule |
|---|---|
| Painted path silhouette | Each segment is cut wherever it crosses a slice boundary, so each piece maps by one stretch. The painted outline is the exact image of the path, within 0.01 dp. |
| Layout from a path | Curves are flattened to within 0.1 dp, then the region moves inward by 0.1 dp more: the silhouette shrinks and every exclusion grows by clearance + 0.1 dp. Path exclusions are flattened to within 0.01 of their own units. Laid-out content is always inside the painted shape. |
| Layout from a mask | A pixel is inside at alpha 128 or more. Runs of 2 px or less are dropped. Each run is narrowed by one canvas pixel at each end, then by 0.5 dp, and a line takes only what every row it covers allows. Islands and holes are kept. |
| The check | Each placed rectangle is checked shrunk by 0.01 dp, for rounding. |
Limits
Developers| Limit | Value |
|---|---|
| Clip path | At most 8192 characters, 256 segments and 4 subpaths; commands M L H V C S Q T Z only; starts with a move |
Clip size | Each side above 0 and at most 2048 |
Clip slice | Whole pixels 0 to 512 for a mask; 0 to 2048 for a path; must leave a middle |
Clip scale | 1 to 4 |
| Clip mask, frame pieces | PNG at most 512 px a side; they count toward the style's 256 KiB of pictures |
| Piece sizes | width and height 0.5 to 128 dp; overlap 0 to 8 dp |
| Frame insets | padding, bleed, bodyRect 0 to 128 dp; radius 0 to 48 dp; minSize 0 to 512 dp |
clearance | 0 to 24 dp |
minLineWidth | 24 to 240 dp |
| Exclusions | At most 8 per style |
| Exclusion path | At most 2048 characters, 64 segments, one subpath |
Exclusion rect | Shares -1 to 2, or canvas units within ±2048; width and height above 0 |
envelope | 0 to 32 dp |
Reaction chip | Each value -48 to 48 dp |
| Named points | At most 8 |
| Card header picture | At most 128 px a side; size 12 to 32 dp |
Card radius | 0 to 24 dp |
| Solver | At most 10 heights; at most 4 growth steps for the safe rectangle |
| Smallest blocks | Photos and video 120 dp wide; cards and replies 160 dp wide |
The theme pack limits apply as well. Check a style with the theme pack checker, which reports errors such as bad clip path, canvas exclusion needs a frame or bad chip.
Design checklist
Designers- Keep heads, tails, feet and notches inside the fixed corner regions, and leave a plain stretchable middle.
- Draw the silhouette on the same canvas as the pieces, so a 16 dp corner piece lines up with a 16 dp fixed region.
- Set
minSizeso corners never have to shrink on a short message, or addcompactart. - Add a
clearanceof about 4 dp, and an exclusion for any art that reaches into the content area. - Give a
reactionspoint achipoffset so reactions hang clear of the words. - Try short, long and multi-line messages, a photo, a code block, a link and a poll, both sides, light and dark, large text and right-to-left text, with Layout guides on. Every bubble should flow, not fall back.