# Droplet.ai block reference

Every block type: fields, limits, how each size draws it, and examples. Heights in points are the ones the layout checker uses; see [design.md](design.md#2-space-budget) for the full budget.

Droplet.ai trims strings to the limits below and drops unknown fields without an error, so a misspelled field silently does nothing.

All blocks also accept:

| Field | Type | Notes |
|---|---|---|
| `url` | string | Opened when the block is tapped, on medium and large (small has one tap target: the widget's `url`). Allowed: `https://`, `tel:`, `sms:`, `mailto:`, `facetime:`, `maps:`, `shortcuts://`, `music://`, `calshow:`, `x-apple-reminderkit://`, `droplet://`. Anything else is rejected. On an `image`, use `link` instead (its `url` is the picture). |
| `color` | string | Hex `#RRGGBB` for the block's main mark (the value, ring, bar, line, list dots, ticks, main button). Overrides the widget `accent`. |
| `sensitive` | boolean | `true` hides this block on the Lock Screen and in StandBy while the phone is locked. |

**Compact blocks** (`metric`, `clock`, ring `gauge`) sit two to a row. Everything else takes a full row.

Every example below is a whole widget that passes the checker with no warnings: medium uses both halves and large is at least half full ([design.md, Use the space](design.md#use-the-space)). That's why most of them pair the block with a second one.

---

## text

| Field | Limit | Notes |
|---|---|---|
| `text` | 400 | Required |
| `style` | | `title` (bold, 17 pt on small, 20 pt elsewhere), `body` (15 pt, default), `caption` (12 pt, grey) |

| Size | Lines | Characters a line (title / body / caption) |
|---|---|---|
| small | up to 4 | ~14 / ~16 / ~21 |
| medium | up to 3 | ~30 / ~40 / ~50 |
| large | up to 6 | ~30 / ~40 / ~50 |

Warnings: a title-style text over 40 characters (wraps to 3+ lines); any text over 120 characters (medium cuts it). On the round Lock Screen widget a text shows only about 12 characters (a note, or a warning when the widget sets `lock`).

```json
{
  "slug": "text-demo",
  "title": "Weather",
  "symbol": "cloud.rain.fill",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "text", "style": "title", "text": "Rain at 3pm" },
    { "type": "text", "text": "Your 3pm run is in the park. Rain from 2 to 5, dry by 6." },
    { "type": "list", "items": ["2pm: light rain", "4pm: heavy rain", "6pm: dry, 24°"] }
  ],
  "sizes": { "small": [0], "medium": [0, 1], "large": [0, 1, 2] },
  "lock": { "circular": 0, "inline": "Rain at 3pm" }
}
```

```json
{
  "slug": "text-rich",
  "title": "Deploys",
  "symbol": "shippingbox.fill",
  "accent": "#30D158",
  "blocks": [
    { "type": "metric", "label": "Tests", "value": "247/247" },
    { "type": "text", "text": "v2.4.1 is ready to ship. All tests passed in 6 min.", "url": "https://ci.example.com/deploys/42" },
    { "type": "list", "title": "In this release", "items": [
      "Faster sign-in",
      "Fix: CSV export dates",
      "New billing page"
    ] }
  ],
  "sizes": { "small": [1], "large": [1, 0, 2] },
  "lock": { "circular": 0, "inline": "v2.4.1 is ready" }
}
```

---

## metric

A big number with a label and an optional change. Compact.

| Field | Limit | Notes |
|---|---|---|
| `label` | 40 | Required. Small grey caption above the value |
| `value` | 24 | Required. A string you format. Keep to ~8 characters: `"$67.2k"`, `"72°"`, `"1,204"` |
| `change` | 16 | Optional. `"+2.1%"`. A leading `-` or `−` turns it red, `0`/`+0%` grey, anything else green |
| `trend` | | `up`, `down`, `flat` to override the colour, or `auto` (default) |

Height: 49 pt on small and large, 41 on medium, plus 16 with `change`. On the Lock Screen round widget: label above, value under it (about 6 characters).

Colour follows the sign, not whether it's good: a falling error rate is red unless you set `trend: "up"` (or write it as an improvement, like "−12% errors" with `trend: "up"`).

```json
{
  "slug": "metric-demo",
  "title": "Bitcoin",
  "symbol": "bitcoinsign.circle.fill",
  "accent": "#F7931A",
  "blocks": [
    { "type": "metric", "label": "BTC", "value": "$67.2k", "change": "+2.1%", "url": "https://www.coingecko.com/en/coins/bitcoin" },
    { "type": "chart", "label": "7 days", "value": "High $68.2k", "style": "area", "values": [65000, 65400, 66100, 65800, 67500, 68200, 67200] }
  ],
  "lock": { "circular": 0, "inline": "BTC $67.2k" }
}
```

---

## list

Rows of text. Each row: `title`, optional `detail`, optional `url`.

| Field | Limit | Notes |
|---|---|---|
| `title` | 40 | Optional heading, shown on large only |
| `items` | 8 | Required. Strings, or `{title, detail, url}` |
| `items[].title` | 140 | Required |
| `items[].detail` | 80 | Trailing grey text, shown on large only |
| `items[].url` | 500 | Opened when the row is tapped (medium and large). **https only** |

| Size | Rows | Row text |
|---|---|---|
| small | 3 | 1 line, ~17 characters |
| medium | 4 (2 when the widget shows buttons) | 1 line, ~41 characters full width, ~23 next to numbers |
| large | 6 (5 with buttons) | up to 2 lines, `detail` on the right |

Put what matters on medium in the `title`, not in `detail`. Items 7 and 8 never show (noted).

```json
{
  "slug": "list-demo",
  "title": "News",
  "symbol": "newspaper.fill",
  "accent": "#FF453A",
  "blocks": [
    { "type": "list", "title": "Top stories", "items": [
      { "title": "Fed holds rates steady", "detail": "Reuters", "url": "https://www.reuters.com/" },
      { "title": "iOS 27.1 is out", "detail": "The Verge", "url": "https://www.theverge.com/" },
      { "title": "Record Q3 for Aramco", "detail": "Bloomberg", "url": "https://www.bloomberg.com/" },
      { "title": "Starship's fifth flight", "detail": "CNN", "url": "https://www.cnn.com/" },
      { "title": "Rain expected tonight", "detail": "Weather" },
      "Markets open higher"
    ] }
  ],
  "lock": { "inline": "6 new stories" }
}
```

---

## progress

`"count": "checked"` makes the bar show the share of the widget's checklist items the user ticked, live (see checklist). Otherwise:

A bar from 0 to 100%.

| Field | Limit | Notes |
|---|---|---|
| `value` | | Required. 0 to 1, or 0 to 100 (anything above 1 is divided by 100). Clamped to 0 to 1, so it can't show over 100%: say "over budget" in the label |
| `label` | 60 | Optional, default "Progress". The percent shows on the right |

Height 26 pt at every size. A value of 0 draws an empty bar (noted). On the round Lock Screen widget: a ring with the percent.

```json
{
  "slug": "progress-demo",
  "title": "Sprint 42",
  "symbol": "flag.fill",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "progress", "label": "Sprint 42", "value": 0.65 },
    { "type": "metric", "label": "Points left", "value": "13" },
    { "type": "metric", "label": "Days left", "value": "4" },
    { "type": "list", "items": ["Export CSV (5 pts)", "Billing page (5 pts)", "Fix sign-in bug (3 pts)"] }
  ],
  "sizes": { "small": [0], "large": [0, 1, 2, 3] },
  "lock": { "circular": 0, "inline": "Sprint 65% done" }
}
```

---

## countdown

A live timer the phone draws itself. No updates needed.

| Field | Limit | Notes |
|---|---|---|
| `to` | | Required. ISO 8601 date-time. **Include the offset that date will have** (`+03:00` or `Z`; daylight saving time can change it, see SKILL.md Process F); without one it's read as UTC, and preview and set_widget warn about it |
| `label` | 40 | Default "Countdown" |
| `from` | | Optional ISO date-time before `to`. Adds a bar that fills from `from` to `to` |
| `style` | | `relative` (default: "2 hr, 5 min", then "Now" once passed), `timer` ("2:05:09", ticking, and counting up after `to`), `date`, `time` |

Height: 41 pt on small, 39 elsewhere, +12 with `from`. Not compact. On the round Lock Screen widget: the live timer (a filling ring with `from`). On the rectangular one, a `timer` style ticks live.

The checker warns when `to` has passed and the style isn't `timer`, but it can only check when you save: a countdown to 14:30 that the user looks at at 15:00 says "Now". When it passes, replace it with the next step (or delete it), or use style `timer` when counting up since something is the point.

```json
{
  "slug": "countdown-demo",
  "title": "Launch",
  "symbol": "flag.checkered",
  "accent": "#FF9F0A",
  "blocks": [
    { "type": "countdown", "label": "Launch", "to": "2027-03-15T09:00:00+03:00", "from": "2027-01-04T09:00:00+03:00" },
    { "type": "checklist", "title": "Before launch", "items": ["Press kit", "Pricing page", "Support macros"] }
  ],
  "sizes": { "small": [0], "medium": [0], "large": [0, 1] },
  "lock": { "circular": 0 }
}
```

---

## clock

The live time in any time zone. Compact.

| Field | Limit | Notes |
|---|---|---|
| `timezone` | 60 | Required. IANA: `America/New_York`, `Europe/London`, `Asia/Riyadh` |
| `label` | 30 | Default: the city from the zone |
| `digit_sum` | | `true` adds the time's digits added up (1:26 → 1+2+6 = 9) |

Height: 49 pt on small and large, 41 on medium, +17 with `digit_sum`. The time format follows the phone (12 or 24 hour).

```json
{
  "slug": "clocks-demo",
  "title": "Team",
  "symbol": "globe",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "clock", "label": "London", "timezone": "Europe/London" },
    { "type": "clock", "label": "Dubai", "timezone": "Asia/Dubai" },
    { "type": "clock", "label": "San Francisco", "timezone": "America/Los_Angeles" },
    { "type": "list", "items": [
      "Kate (London): online until 6pm",
      "Omar (Dubai): in a meeting",
      "Ana (SF): starts at 9am"
    ] }
  ],
  "sizes": { "small": [0, 1], "medium": [0, 1, 2], "large": [0, 1, 2, 3] },
  "lock": { "circular": 0, "inline": "Team clocks" }
}
```

With `sizes.medium` set, the three clocks pair up: two in a row, one under (41 + 10 + 41). Without it, medium shows only the first two clocks and the list. `layout: "grid"` shows only 2 cells on medium. Large adds who's around.

---

## gauge

A ring (compact) or a bar between `min` and `max`.

| Field | Limit | Notes |
|---|---|---|
| `value` | | Required number. Clamped to `min`..`max` |
| `min` | | Default 0 |
| `max` | | Default 1, or 100 when `value` > 1. Must be above `min` |
| `label` | 30 | Optional caption |
| `text` | 8 | Text in the ring (4 characters or fewer read best: `"72%"`, `"3/5"`). Default: the percent |
| `style` | | `ring` (default, compact) or `bar` (full width, like progress) |
| `count` | | `"checked"`: the ring counts the widget's ticked checklist items itself ("3/8"). Leave out `value`, `min`, `max` and `text`. It moves the instant the user ticks, with no agent running. Needs Droplet.ai build 36 or later (older builds show the count as of your last update) |

Ring diameter: 74 pt on small, 56 on medium, 64 on large, plus 21 for a label. Two labelled rings stacked in the medium left column don't fit (77 + 10 + 77). On the round Lock Screen widget it becomes the system ring. For steps or exercise, a ring toward the goal (`value` 478, `max` 8000, `text` "478") reads like the Health app.

```json
{
  "slug": "gauge-demo",
  "title": "Water",
  "symbol": "drop.fill",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "gauge", "label": "Glasses", "value": 5, "max": 8, "text": "5/8" },
    { "type": "chart", "label": "This week", "style": "bar", "values": [8, 6, 7, 8, 5, 7, 5] }
  ],
  "lock": { "circular": 0, "inline": "Water 5 of 8" }
}
```

---

## chart

A sparkline: no axes, just the shape. Full width.

| Field | Limit | Notes |
|---|---|---|
| `values` | 2 to 48 | Required numbers, oldest first |
| `label` | 40 | Caption above |
| `value` | 24 | The current number, above the line |
| `change` | 16 | Short change; sign sets the colour like `metric` |
| `trend` | | `up`, `down`, `flat`, `auto` |
| `style` | | `line` (default), `area`, `bar` |

Height: 32 pt for the line, +18 with `label` or `change`, +28 with `value` (+33 on small). All-equal values draw a flat line (noted). No axes or reference line, so put the target in the label ("Burndown · goal 0").

```json
{
  "slug": "chart-demo",
  "title": "BTC",
  "symbol": "chart.line.uptrend.xyaxis",
  "accent": "#F7931A",
  "blocks": [
    { "type": "chart", "label": "BTC 7 days", "value": "$67.2k", "change": "+2.1%", "style": "area", "values": [65000, 65400, 66100, 65800, 67500, 68200, 67200] },
    { "type": "list", "items": ["High $68.2k on Saturday", "Low $65.0k on Monday", "Your alert is at $70k"] }
  ],
  "sizes": { "small": [0], "medium": [0], "large": [0, 1] },
  "lock": { "inline": "BTC $67.2k" }
}
```

---

## checklist

Items the user ticks on the widget (or in the Droplet.ai app). Droplet.ai saves each tick at once and sends you a `check` event.

| Field | Limit | Notes |
|---|---|---|
| `title` | 40 | Heading, shown on large only |
| `items` | 8 | Required. Strings (not done) or `{title, done}` |
| `items[].title` | 80 | Required |
| `items[].done` | | `true` if ticked |

Rows: 3 on small, 4 on medium (2 when the widget shows buttons), 6 on large (5 with buttons). Items 7 and 8 never show.

**The user's ticks win.** When you resend a checklist, any item the user ticked (matched by title) stays ticked, so an update can't undo them. To clear the list on purpose (a new day, a fresh list), send `"reset_checklists": true` with the update. Ticks inside a version are stored in that version.

**Count ticks with a ring.** Put a gauge (or progress) with `"count": "checked"` in the same widget: it shows ticked / total and moves the instant the user ticks, with nothing running on your side. Water glasses, sets at the gym, chores, packing:

```json
{ "slug": "water", "title": "Water", "symbol": "drop.fill", "accent": "#0A84FF",
  "blocks": [
    { "type": "gauge", "label": "Today", "count": "checked" },
    { "type": "checklist", "items": ["Glass 1", "Glass 2", "Glass 3", "Glass 4", "Glass 5", "Glass 6", "Glass 7", "Glass 8"] }
  ] }
```

Reset it each night with a scheduled update that sends `reset_checklists: true`, or with versions by day.

The `check` event: `target` is the item title, `value` is `{"done", "block", "item"}` (plus `"variant"` inside a version). Use `block` and `item` when two items share a title.

```json
{
  "slug": "checklist-demo",
  "title": "Today",
  "symbol": "checklist",
  "accent": "#30D158",
  "blocks": [
    { "type": "checklist", "title": "Today", "items": [
      { "title": "Water 2L", "done": false },
      { "title": "Walk 30 min", "done": true },
      "No phone after 10pm",
      "Read 20 pages",
      "Stretch 10 min"
    ] },
    { "type": "progress", "label": "Done", "value": 0.2 }
  ],
  "sizes": { "small": [1], "medium": [0], "large": [0, 1] },
  "lock": { "circular": 1, "inline": "1 of 5 done" }
}
```

---

## buttons

1 to 4 buttons. A button without `url` sends you an event; one with `url` opens it instead.

| Field | Limit | Notes |
|---|---|---|
| `items` | 1 to 4 | Required. Strings (a label) or objects |
| `items[].label` | 24 | Required |
| `items[].id` | 30 | Optional. What you get as the event `target`. Defaults to the label slugified (`"Re-run"` → `re-run`). Must be unique in the block |
| `items[].symbol` | 60 | SF Symbol. Give every button one |
| `items[].url` | 500 | Opens instead of sending an event. Same schemes as block `url` |

Button items take only those four fields. To colour the main (first) button, set the block's `color`.

How they show:
- Never laid out with the other blocks: the first `buttons` block a size shows is pinned to the bottom edge as a row of equal tiles across the full width (40 pt tall on small and medium, 44 on large, plus a 6 or 10 pt gap). That leaves about 58 pt above it on small, 50 on medium and 242 on large, and lists and checklists show fewer rows (2 on medium, 5 on large).
- Small: shown only if it's the first block or chosen in `sizes.small`; at most 2 buttons, as symbols only. If the buttons are block 0 and there's no `sizes.small`, small shows just the buttons.
- Medium and large: up to 4, labels and symbols. Keep labels to one or two short words; a label too long for its tile is cut (noted).
- The first button is filled with the accent; the rest are grey.
- Tapped: "Sent" at once, "Seen" when you pick the tap up, back to normal when you update the widget. Sent and Seen fade after 2 minutes.
- The user can also put any event button in Control Center, on the Lock Screen or on the Action button (Droplet.ai's "Agent button" control). Those taps arrive with `source: "control"` and the same `id`, so keep ids stable.
- Not on the Lock Screen widgets.

```json
{
  "slug": "buttons-demo",
  "title": "Deploy",
  "symbol": "shippingbox.fill",
  "blocks": [
    { "type": "text", "text": "v2.4.1 is ready for production. All 247 tests passed." },
    { "type": "buttons", "color": "#30D158", "items": [
      { "label": "Ship", "id": "ship", "symbol": "paperplane.fill" },
      { "label": "Hold", "id": "hold", "symbol": "pause.fill" },
      { "label": "Logs", "symbol": "doc.text", "url": "https://ci.example.com/runs/42" }
    ] },
    { "type": "text", "text": "Ship?" },
    { "type": "list", "title": "In this release", "items": [
      "Faster sign-in",
      "Fix: CSV export dates",
      "New billing page"
    ] }
  ],
  "sizes": { "small": [0], "medium": [0, 1], "large": [0, 3, 1] },
  "lock": { "circular": 2 }
}
```

---

## image

A photo from an https URL.

| Field | Limit | Notes |
|---|---|---|
| `url` | 500 | Required. https PNG, JPEG, HEIC or WebP, under 8 MB |
| `fit` | | `fill` (crop, default) or `fit` (whole picture) |
| `caption` | 60 | Short text over the bottom of the picture |
| `link` | 500 | Opened when the picture is tapped |

Height 60 pt in the checker. The phone downloads the picture when it refreshes; until then it shows a placeholder (noted). Use fast, stable URLs, not signed links that expire. Never put secrets (a Wi-Fi password, a code) into a third-party image URL such as a QR generator.

```json
{
  "slug": "image-demo",
  "title": "Photo of the day",
  "symbol": "photo",
  "blocks": [
    { "type": "image", "url": "https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=800", "caption": "Lofoten", "link": "https://unsplash.com/" },
    { "type": "text", "text": "Lofoten, Norway, at 4am in June, when the sun never sets." },
    { "type": "list", "items": ["Saved to your wallpapers", "Tomorrow: Wadi Rum"] }
  ],
  "sizes": { "small": [0], "medium": [0], "large": [0, 1, 2] },
  "lock": { "inline": "Photo of the day" }
}
```

---

## map

A map of a place with a pin: a real Apple Maps snapshot that the phone draws itself. Use it for any location instead of coordinates in text. Spans the width.

| Field | Limit | Notes |
|---|---|---|
| `lat` | -90 to 90 | Required. A number, like `24.6936`. Rounded to 5 decimals |
| `lon` | -180 to 180 | Required. A number, like `46.6853` |
| `label` | 40 | The place's name, shown with the pin ("Al Olaya, Riyadh"). Take it from the context's `place` or `city`, or the venue's name |
| `span` | 100 to 50000 | How many metres across the map shows. Default 800 (a neighbourhood); 5000 is a district, 20000 a city |

Height 60 pt in the checker. The phone makes the snapshot a few seconds after a refresh; until then it shows a map placeholder (noted). The block takes `url`, `color` and `sensitive` like any other; `sensitive: true` hides it while the phone is locked, which is right for the user's own location. Needs Droplet.ai build 33 or later; older builds show nothing for it.

The phone context's `location` has `lat` and `lon` when the user shares it. Never print coordinates in text: the map and its `label` say where.

```json
{
  "slug": "where",
  "title": "Where you are",
  "symbol": "location.fill",
  "accent": "#0A84FF",
  "blocks": [
    { "type": "metric", "label": "Battery", "value": "64%" },
    { "type": "map", "lat": 24.6936, "lon": 46.6853, "label": "Al Olaya, Riyadh", "span": 1500 },
    { "type": "list", "items": ["Home is 12 min away", "Next: Design review at 14:00"] }
  ],
  "sizes": { "small": [1], "large": [1, 0, 2] },
  "lock": { "circular": 0, "inline": "Al Olaya, Riyadh" }
}
```

---

## Limits at a glance

| | Limit |
|---|---|
| blocks per widget | 8 |
| list / checklist items | 8 (6 visible at most) |
| buttons per block | 4 |
| chart values | 2 to 48 |
| text | 400 |
| metric | label 40, value 24, change 16 |
| list | title 40, item title 140, detail 80 |
| checklist | title 40, item title 80 |
| buttons | label 24, id 30 |
| progress label | 60 |
| countdown label | 40 |
| clock label | 30 |
| gauge | label 30, text 8 |
| chart | label 40, value 24, change 16 |
| image caption | 60 |
| map | label 40, span 100 to 50000 m |
