Skip to content

Media

Images, shapes, and declarative canvas.

image

Tier: core

Image from SF Symbol / drawable name, base64 data, or URL.

image (image-sources.medium)

From showcase preset — case image-sources.medium.

Properties

PropertyTypeDefaultDescription
backgroundBackgroundValueSolid, adaptive, or gradient background.
borderBorderConfigBorder color and width.
clipShapeClipShapeClip content to a shape (e.g. circle avatar from square image).
colorColorValueTint color for template / symbol images.
contentModeContentModeHow the image fills its frame (fit or fill).
cornerRadiusnumberCorner radius in points.
datastringBase64-encoded image data (with or without data:image/...;base64, prefix).
flexnumberLayout weight for flexible sizing inside stacks (like Android layout_weight).
frameFrameConfigExplicit width / height / max constraints.
opacitynumberOpacity from 0 (invisible) to 1 (opaque).
paddingPaddingValueInset padding (number or per-edge object).
shadowShadowConfigDrop shadow.
sizenumberDisplay size in points.
systemNamestringSF Symbol name (Apple) or Material / drawable name (Android).
urlstringRemote image URL (platform support varies — see capability matrix).

Examples

Minimal

json
{
  "type": "image",
  "systemName": "cloud.sun.fill",
  "size": 28,
  "color": "#ffcc00",
  "contentMode": "fit"
}

From showcase image-sources.medium

json
{
  "type": "image",
  "systemName": "star.fill",
  "size": 32,
  "color": "#fbbf24"
}
json
{
  "type": "image",
  "systemName": "gear",
  "size": 14,
  "color": "#38bdf8"
}

Inside a WidgetConfig

json
{
  "small": {
    "type": "image",
    "systemName": "cloud.sun.fill",
    "size": 28,
    "color": "#ffcc00",
    "contentMode": "fit"
  }
}

shape

Tier: core

Colored shape — circle, capsule, or rectangle.

shape (container-card.small)

From showcase preset — case container-card.small.

Properties

PropertyTypeDefaultDescription
backgroundBackgroundValueSolid, adaptive, or gradient background.
borderBorderConfigBorder color and width.
clipShapeClipShapeClip content to a shape (e.g. circle avatar from square image).
cornerRadiusnumberCorner radius in points.
fillColorValueFill color.
flexnumberLayout weight for flexible sizing inside stacks (like Android layout_weight).
frameFrameConfigExplicit width / height / max constraints.
opacitynumberOpacity from 0 (invisible) to 1 (opaque).
paddingPaddingValueInset padding (number or per-edge object).
shadowShadowConfigDrop shadow.
shapeTypeanyShape kind.
sizenumberBounding size in points.
strokeColorValueStroke color.
strokeWidthnumberStroke width in points.

Examples

Minimal

json
{
  "type": "shape",
  "shapeType": "capsule",
  "fill": "#ef4444",
  "size": 12,
  "stroke": "#fff",
  "strokeWidth": 1
}

From showcase container-card.small

json
{
  "type": "shape",
  "shapeType": "circle",
  "size": 36,
  "fill": "#3b82f6"
}

From showcase flex-stroke-grid.medium

json
{
  "type": "shape",
  "shapeType": "rectangle",
  "size": 36,
  "fill": "#1e293b",
  "stroke": "#22c55e",
  "strokeWidth": 2,
  "cornerRadius": 8,
  "flex": 1
}

Inside a WidgetConfig

json
{
  "small": {
    "type": "shape",
    "shapeType": "capsule",
    "fill": "#ef4444",
    "size": 12,
    "stroke": "#fff",
    "strokeWidth": 1
  }
}

canvas

Tier: extended

Declarative canvas — draw arbitrary shapes via JSON commands.

canvas (canvas-draws.small)

From showcase preset — case canvas-draws.small.

Properties

PropertyTypeDefaultDescription
backgroundBackgroundValueSolid, adaptive, or gradient background.
borderBorderConfigBorder color and width.
clipShapeClipShapeClip content to a shape (e.g. circle avatar from square image).
cornerRadiusnumberCorner radius in points.
elementsCanvasDrawCommand[]Draw commands (circle, line, rect, arc, text, path).
flexnumberLayout weight for flexible sizing inside stacks (like Android layout_weight).
frameFrameConfigExplicit width / height / max constraints.
heightnumberCanvas height in points.
opacitynumberOpacity from 0 (invisible) to 1 (opaque).
paddingPaddingValueInset padding (number or per-edge object).
shadowShadowConfigDrop shadow.
widthnumberCanvas width in points.

Examples

Minimal

json
{
  "type": "canvas",
  "width": 80,
  "height": 80,
  "background": "#0f172a",
  "cornerRadius": 12,
  "elements": [
    {
      "draw": "circle",
      "cx": 40,
      "cy": 40,
      "r": 28,
      "fill": "#1e293b",
      "stroke": "#38bdf8",
      "strokeWidth": 2
    },
    {
      "draw": "text",
      "x": 40,
      "y": 44,
      "content": "72",
      "fontSize": 18,
      "color": "#fff",
      "anchor": "middle"
    }
  ]
}

From showcase canvas-draws.small (size root)

json
{
  "type": "canvas",
  "width": 146,
  "height": 146,
  "background": "#0b1220",
  "cornerRadius": 12,
  "elements": [
    {
      "draw": "rect",
      "x": 12,
      "y": 12,
      "width": 48,
      "height": 32,
      "fill": "#1e293b",
      "stroke": "#38bdf8",
      "strokeWidth": 2,
      "cornerRadius": 6
    },
    {
      "draw": "circle",
      "cx": 110,
      "cy": 36,
      "r": 18,
      "fill": "#22c55e",
      "stroke": "#86efac",
      "strokeWidth": 2
    },
    {
      "draw": "arc",
      "cx": 48,
      "cy": 90,
      "r": 28,
      "startAngle": -90,
      "endAngle": 120,
      "stroke": "#f59e0b",
      "strokeWidth": 4
    },
    {
      "draw": "path",
      "d": "M90 70 L130 110 L90 110 Z",
      "fill": "#a855f7",
      "stroke": "#e9d5ff",
      "strokeWidth": 1
    },
    {
      "draw": "text",
      "x": 73,
      "y": 136,
      "content": "draw",
      "fontSize": 12,
      "color": "#e2e8f0",
      "anchor": "middle"
    }
  ]
}

From showcase canvas-scale.small

json
{
  "type": "canvas",
  "width": 60,
  "height": 60,
  "elements": [
    {
      "draw": "circle",
      "cx": 30,
      "cy": 30,
      "r": 25,
      "fill": "#1e40af",
      "stroke": "#fff",
      "strokeWidth": 2
    },
    {
      "draw": "line",
      "x1": 30,
      "y1": 30,
      "x2": 30,
      "y2": 10,
      "stroke": "#fff",
      "strokeWidth": 2
    }
  ]
}

Inside a WidgetConfig

json
{
  "small": {
    "type": "canvas",
    "width": 80,
    "height": 80,
    "background": "#0f172a",
    "cornerRadius": 12,
    "elements": [
      {
        "draw": "circle",
        "cx": 40,
        "cy": 40,
        "r": 28,
        "fill": "#1e293b",
        "stroke": "#38bdf8",
        "strokeWidth": 2
      },
      {
        "draw": "text",
        "x": 40,
        "y": 44,
        "content": "72",
        "fontSize": 18,
        "color": "#fff",
        "anchor": "middle"
      }
    ]
  }
}

Released under the MIT License. · Contributing