Shapes
Shape elements draw simple vector shapes. They’re perfect for card backgrounds, dividers, dots and outlines.
{ "type": "shape", "shape": "rect", "size": [0.26, 0.15], "cornerRadius": 0.025, "fill": "#00000059" }| Field | Required | Meaning |
|---|---|---|
type |
yes | "shape" |
size |
yes | [width, height] as fractions of the screen height |
shape |
no | "rect" (default), "circle" or "line" |
fill |
no | Inside color |
stroke |
no | Outline color |
strokeWidth |
no | Outline thickness (fraction of the screen height) |
cornerRadius |
no | Corner rounding for rect |
color |
no | Fill when there’s no fill or stroke; the color of lines |
Rectangles
Section titled “Rectangles”{ "type": "shape", "size": [0.3, 0.08], "cornerRadius": 0.04, "fill": "#FFFFFF1A", "stroke": "#FFFFFF40", "strokeWidth": 0.001 }cornerRadiusis capped at half the shorter side, so a radius of half the height makes a pill.- With neither
fillnorstroke, a rectangle is filled withcolor, or white. - With only a
stroke, it’s an outline.
Circles
Section titled “Circles”"shape": "circle" draws an ellipse that fills size; use equal width and height for a circle:
{ "type": "shape", "shape": "circle", "size": [0.012, 0.012], "fill": "#FF4F8B", "offset": [-0.1, 0] }A small dot like this makes a nice status light or bullet.
"shape": "line" draws a horizontal line, as wide as size’s width, with round ends:
{ "type": "shape", "shape": "line", "size": [0.2, 0.002], "color": "#FFFFFF66" }- The line’s thickness is
size’s height, orstrokeWidthif set. - Its color is
stroke, orcolor, or white.
For a vertical divider, use a thin rectangle: "size": [0.002, 0.06].
Shapes and the person’s color
Section titled “Shapes and the person’s color”Shapes keep their own colors when people pick a color for the widget. That’s usually what you want for backgrounds. If you want an accent shape to follow their color, use a progress bar with "value": "1" instead: its fill follows the picked color.
Turn off the shadow on backgrounds
Section titled “Turn off the shadow on backgrounds”Every element has a soft shadow by default. Behind a translucent card it looks muddy, so turn it off:
"shadow": falseRecipes
Section titled “Recipes”Frosted card:
{ "type": "shape", "size": [0.3, 0.16], "cornerRadius": 0.024, "fill": "#0000004D", "stroke": "#FFFFFF26", "strokeWidth": 0.001, "shadow": false }Pill behind a label:
{ "type": "shape", "size": [0.12, 0.03], "cornerRadius": 0.015, "fill": "#FFFFFF26", "shadow": false },{ "text": "LIVE", "font": { "family": "Michroma", "size": 0.011 }, "tracking": 0.2 }Divider between two lines of text:
{ "type": "shape", "shape": "line", "size": [0.12, 0.0015], "opacity": 0.5, "offset": [0, 0.03] }