Elements
Style
All elements support:
{
"padding": 12,
"background": "#1a1a2e",
"cornerRadius": 8,
"opacity": 0.9,
"frame": { "width": 100, "height": 50, "maxWidth": "infinity" },
"border": { "color": "#333333", "width": 1 },
"shadow": { "color": "#000000", "radius": 4, "x": 0, "y": 2 },
"clipShape": "circle",
"flex": 1
}
clipShape — Content Masking
Clips the element's content to a shape. Useful for circular avatars, pill-shaped badges, etc.
| Value | Description |
|---|---|
"circle" | Perfect circle (50% border-radius) |
"capsule" | Pill shape (fully rounded ends) |
"rectangle" | Rectangle with cornerRadius applied |
Platform mapping: SwiftUI
.clipShape(), CSSborder-radius+overflow: hidden, Android Glance shape clipping.
flex — Proportional Layout
The flex property allows elements to occupy available space proportionally within stacks, analogous to CSS flex, Android layout_weight, or SwiftUI layoutPriority.
{
"type": "hstack",
"children": [
{ "type": "text", "content": "Left", "flex": 1 },
{ "type": "text", "content": "Center (wider)", "flex": 2 },
{ "type": "text", "content": "Right", "flex": 1 }
]
}
Accessibility and privacy
| Field | Type | Effect |
|---|---|---|
accessibilityLabel | string | Screen-reader text instead of the visible content (VoiceOver, TalkBack, aria-label) |
privacySensitive | boolean | Redacted where the OS hides private data: iOS / macOS locked screen and StandBy. No effect on Android, desktop or Widgets Board |
{ "type": "text", "content": "$12,480", "privacySensitive": true, "accessibilityLabel": "Balance" }
Data binding (bind)
{{data.path}} fills strings only. For numbers, booleans or arrays, bind the field itself:
{ "type": "progress", "value": 0, "bind": { "value": "data.progress" } }
{ "type": "chart", "chartType": "bar", "chartData": [], "bind": { "chartData": "data.points" } }
The value keeps its JSON type; a missing data value keeps the literal. Other expressions
(t.key, locale, instance) render as text. Works on every platform.