Elements

Interactive elements

Buttons, toggles, and tappable wrappers.

button

Tier: core

Tappable button that opens a URL or emits widget-action.

From showcase preset — case calculator.small.

Properties

PropertyTypeDefaultDescription
accentableboolean—Apple tinted / accented Home Screen: draw this part in the accent color (widgetAccentable). Ignored elsewhere.
accessibilityLabelstring—Text read by screen readers instead of the visible content.
actionstring—Action identifier — emits a widget-action Tauri event when tapped.
aspectRationumber—Keep width / height at this ratio (1 = square).
backgroundBackgroundValue—Solid, adaptive, or gradient background.
backgroundColorColorValue—Button background color.
bindobject—Set fields from data with their JSON type: {"value": "data.progress"}. Use for numbers / booleans / arrays ({{…}} only fills strings).
borderBorderConfig—Border color and width.
clipShapeClipShape—Clip content to a shape (e.g. circle avatar from square image).
colorColorValue—Label text color.
cornerRadiusnumber—Corner radius in points.
disabledboolean—Draw dimmed and ignore taps.
flexnumber—Layout weight for flexible sizing inside stacks (like Android layout_weight).
fontSizenumber—Label font size in points.
frameFrameConfig—Explicit width / height / max constraints.
labelstring—Button label text.
layoutPrioritynumber—Who keeps its size in a crowded stack: higher first. Default 0.
marginPaddingValue—Outer spacing (number or per-edge object), outside background and border.
offsetXnumber—Move right by points after layout (does not affect siblings).
offsetYnumber—Move down by points after layout (does not affect siblings).
opacitynumber—Opacity from 0 (invisible) to 1 (opaque).
paddingPaddingValue—Inset padding (number or per-edge object).
privacySensitiveboolean—Hide this content where the OS redacts private data (iOS / macOS locked screen, StandBy). Ignored where no redaction exists.
rotationnumber—Rotate by degrees (clockwise).
scalenumber—Scale factor (1 = unchanged).
setobject—Local state written on tap, in-process (no app needed): {"done": "$toggle"}. "$toggle" flips a boolean (missing → true), "$inc" / "$dec" add / subtract 1 (missing → 0 first), null removes the key (the default shows again), any other JSON is stored as is. With action too, the action is sent after the write.
shadowShadowConfig—Drop shadow.
systemNamestring—Icon (SF Symbol name; Material / emoji elsewhere) before the label.
textAlignmentTextAlignment—Label text alignment.
transitionTransition—How this element changes between timeline entries / redraws (a hint): numeric animates digits, opacity cross-fades, slide pushes from the bottom. Apple and desktop animate; Android and Adaptive Cards ignore it.
urlstring—Deep link URL to open the app (used when no action is set).
variantButtonVariant—Visual style (bordered, prominent, plain, outline). Unset keeps each platform's classic button look; set it for the same look everywhere.
whenobject—Show only when the condition holds ({"path": "data.n", "gt": 0}; see crate::resolve). Removed before rendering.

Examples

Minimal

{
  "type": "button",
  "label": "Refresh",
  "action": "refresh",
  "color": "#fff",
  "backgroundColor": "#0284c7",
  "fontSize": 14,
  "cornerRadius": 10
}

From showcase calculator.small

{
  "type": "button",
  "label": "C",
  "action": "calc:C",
  "backgroundColor": "#636366",
  "color": "#fff",
  "fontSize": 10,
  "cornerRadius": 6,
  "padding": {
    "top": 1,
    "bottom": 1,
    "leading": 2,
    "trailing": 2
  }
}

From showcase layout.small

{
  "type": "button",
  "label": "Go",
  "action": "go",
  "backgroundColor": "#2196F3",
  "color": "#fff"
}

Inside a WidgetConfig

{
  "small": {
    "type": "button",
    "label": "Refresh",
    "action": "refresh",
    "color": "#fff",
    "backgroundColor": "#0284c7",
    "fontSize": 14,
    "cornerRadius": 10
  }
}

toggle

Tier: extended

On/off toggle control.

From showcase preset — case stress-nest.large.

Properties

PropertyTypeDefaultDescription
accentableboolean—Apple tinted / accented Home Screen: draw this part in the accent color (widgetAccentable). Ignored elsewhere.
accessibilityLabelstring—Text read by screen readers instead of the visible content.
actionstring—Action identifier sent back to the app.
aspectRationumber—Keep width / height at this ratio (1 = square).
backgroundBackgroundValue—Solid, adaptive, or gradient background.
bindobject—Set fields from data with their JSON type: {"value": "data.progress"}. Use for numbers / booleans / arrays ({{…}} only fills strings).
borderBorderConfig—Border color and width.
clipShapeClipShape—Clip content to a shape (e.g. circle avatar from square image).
cornerRadiusnumber—Corner radius in points.
flexnumber—Layout weight for flexible sizing inside stacks (like Android layout_weight).
frameFrameConfig—Explicit width / height / max constraints.
isOnboolean—Whether the toggle is on.
labelstring—Optional label beside the control.
layoutPrioritynumber—Who keeps its size in a crowded stack: higher first. Default 0.
marginPaddingValue—Outer spacing (number or per-edge object), outside background and border.
offsetXnumber—Move right by points after layout (does not affect siblings).
offsetYnumber—Move down by points after layout (does not affect siblings).
opacitynumber—Opacity from 0 (invisible) to 1 (opaque).
paddingPaddingValue—Inset padding (number or per-edge object).
privacySensitiveboolean—Hide this content where the OS redacts private data (iOS / macOS locked screen, StandBy). Ignored where no redaction exists.
rotationnumber—Rotate by degrees (clockwise).
scalenumber—Scale factor (1 = unchanged).
setobject—Local state written on tap, in-process (no app needed): {"done": "$toggle"}. "$toggle" flips a boolean (missing → true), "$inc" / "$dec" add / subtract 1 (missing → 0 first), null removes the key (the default shows again), any other JSON is stored as is. With action too, the action is sent after the write.
shadowShadowConfig—Drop shadow.
tintColorValue—Accent color when on.
transitionTransition—How this element changes between timeline entries / redraws (a hint): numeric animates digits, opacity cross-fades, slide pushes from the bottom. Apple and desktop animate; Android and Adaptive Cards ignore it.
uncheckedTintColorValue—Color when off.
variantToggleVariant—switch or checkbox. Unset keeps each platform's classic toggle (a glyph on Android); set it for the same control everywhere.
whenobject—Show only when the condition holds ({"path": "data.n", "gt": 0}; see crate::resolve). Removed before rendering.

Examples

Minimal

{
  "type": "toggle",
  "isOn": true,
  "label": "Dark mode",
  "tint": "#38bdf8",
  "action": "toggle-dark"
}

From showcase stress-nest.large

{
  "type": "toggle",
  "isOn": true,
  "action": "stress_toggle"
}

From showcase toggle-row.small

{
  "type": "toggle",
  "isOn": true,
  "label": "Wi-Fi",
  "tint": "#22c55e",
  "color": "#e2e8f0",
  "action": "toggle_wifi"
}

Inside a WidgetConfig

{
  "small": {
    "type": "toggle",
    "isOn": true,
    "label": "Dark mode",
    "tint": "#38bdf8",
    "action": "toggle-dark"
  }
}

Tier: core

Tappable wrapper — makes nested content clickable.

From showcase preset — case link-chip.small.

Properties

PropertyTypeDefaultDescription
accentableboolean—Apple tinted / accented Home Screen: draw this part in the accent color (widgetAccentable). Ignored elsewhere.
accessibilityLabelstring—Text read by screen readers instead of the visible content.
actionstring—Action identifier — emits widget-action event.
aspectRationumber—Keep width / height at this ratio (1 = square).
backgroundBackgroundValue—Solid, adaptive, or gradient background.
bindobject—Set fields from data with their JSON type: {"value": "data.progress"}. Use for numbers / booleans / arrays ({{…}} only fills strings).
borderBorderConfig—Border color and width.
childrenWidgetElement[]—Nested content to wrap.
clipShapeClipShape—Clip content to a shape (e.g. circle avatar from square image).
cornerRadiusnumber—Corner radius in points.
flexnumber—Layout weight for flexible sizing inside stacks (like Android layout_weight).
frameFrameConfig—Explicit width / height / max constraints.
layoutPrioritynumber—Who keeps its size in a crowded stack: higher first. Default 0.
marginPaddingValue—Outer spacing (number or per-edge object), outside background and border.
offsetXnumber—Move right by points after layout (does not affect siblings).
offsetYnumber—Move down by points after layout (does not affect siblings).
opacitynumber—Opacity from 0 (invisible) to 1 (opaque).
paddingPaddingValue—Inset padding (number or per-edge object).
privacySensitiveboolean—Hide this content where the OS redacts private data (iOS / macOS locked screen, StandBy). Ignored where no redaction exists.
rotationnumber—Rotate by degrees (clockwise).
scalenumber—Scale factor (1 = unchanged).
setobject—Local state written on tap, in-process (no app needed): {"done": "$toggle"}. "$toggle" flips a boolean (missing → true), "$inc" / "$dec" add / subtract 1 (missing → 0 first), null removes the key (the default shows again), any other JSON is stored as is. With action too, the action is sent after the write.
shadowShadowConfig—Drop shadow.
transitionTransition—How this element changes between timeline entries / redraws (a hint): numeric animates digits, opacity cross-fades, slide pushes from the bottom. Apple and desktop animate; Android and Adaptive Cards ignore it.
urlstring—Deep-link URL to open.
whenobject—Show only when the condition holds ({"path": "data.n", "gt": 0}; see crate::resolve). Removed before rendering.

Examples

Minimal

{
  "type": "link",
  "action": "open-details",
  "payload": "item-1",
  "children": [
    {
      "type": "hstack",
      "spacing": 6,
      "alignment": "center",
      "children": [
        {
          "type": "text",
          "content": "Details",
          "color": "#38bdf8",
          "fontWeight": "medium"
        },
        {
          "type": "image",
          "systemName": "chevron.right",
          "size": 12,
          "color": "#38bdf8"
        }
      ]
    }
  ]
}
{
  "type": "link",
  "action": "open_settings",
  "padding": 8,
  "cornerRadius": 999,
  "background": "#1e293b",
  "children": [
    {
      "type": "hstack",
      "spacing": 6,
      "alignment": "center",
      "children": [
        {
          "type": "image",
          "systemName": "gear",
          "size": 14,
          "color": "#38bdf8"
        },
        {
          "type": "text",
          "content": "Settings",
          "fontSize": 13,
          "fontWeight": "medium",
          "color": "#e2e8f0"
        }
      ]
    }
  ]
}

From showcase stress-nest.large

{
  "type": "link",
  "action": "open_settings",
  "padding": 8,
  "cornerRadius": 8,
  "background": "#334155",
  "children": [
    {
      "type": "text",
      "content": "Link",
      "fontSize": 12,
      "color": "#38bdf8"
    }
  ]
}

Inside a WidgetConfig

{
  "small": {
    "type": "link",
    "action": "open-details",
    "payload": "item-1",
    "children": [
      {
        "type": "hstack",
        "spacing": 6,
        "alignment": "center",
        "children": [
          {
            "type": "text",
            "content": "Details",
            "color": "#38bdf8",
            "fontWeight": "medium"
          },
          {
            "type": "image",
            "systemName": "chevron.right",
            "size": 12,
            "color": "#38bdf8"
          }
        ]
      }
    ]
  }
}