Example
Habit grid
Five weeks of history, built from stacks.
compositionshapesopacity
json
{
"v": 1,
"preferredFamily": "systemLarge",
"refresh": 3600,
"accessibility": "Reading habit, 24 of the last 35 days complete, 6 day streak",
"view": {
"type": "vstack",
"align": "leading",
"spacing": 12,
"padding": 16,
"bg": "#1A1013",
"children": [
{
"type": "hstack",
"spacing": 8,
"children": [
{
"type": "symbol",
"name": "book.fill",
"style": "headline",
"color": "#D08A7A"
},
{
"type": "text",
"text": "Reading",
"style": "headline",
"color": "white"
},
{"type": "spacer"},
{
"type": "symbol",
"name": "flame.fill",
"style": "caption",
"color": "orange"
},
{
"type": "text",
"text": "6 day streak",
"style": "caption",
"color": "#D08A7A"
}
]
},
{
"type": "hstack",
"spacing": 6,
"children": [
{
"type": "vstack",
"spacing": 6,
"children": [
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/50"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"}
]
},
{
"type": "vstack",
"spacing": 6,
"children": [
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/50"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"}
]
},
{
"type": "vstack",
"spacing": 6,
"children": [
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/50"}
]
},
{
"type": "vstack",
"spacing": 6,
"children": [
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/50"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"}
]
},
{
"type": "vstack",
"spacing": 6,
"children": [
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/75"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green/50"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "#2E1B1F"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"},
{"type": "rect", "w": 30, "h": 30, "corner": 8, "fill": "green"}
]
}
]
},
{"type": "spacer"},
{
"type": "hstack",
"spacing": 8,
"children": [
{
"type": "text",
"text": "24 of 35 days",
"style": "caption",
"color": "#D08A7A"
},
{"type": "spacer"},
{
"type": "gauge",
"value": 24,
"min": 0,
"max": 35,
"tint": "green",
"track": "green/20",
"w": 120
}
]
}
]
}
} How it works
The grid of cells is an hstack of vstacks. Each cell is a rect with a w, an h and a corner. Its fill takes any colour.
An opacity on one colour makes the scale: green/25, green/50, green/75 and green. Every filled cell is the semantic green, so the grid is legible in dark mode and in tinted rendering.
This payload has 35 cells plus their containers. The limit is 300 nodes. See limits.
Put it on your Home Screen
We serve this example at the URL below. The server generates the timestamps at the time of each request. Add the URL as a hook in the app, and the widget works on your phone.
URL
https://webhookwidget.com/demo/habits Next
AI spend this month: What Claude and OpenAI have cost so far, against a monthly budget.
All examples