Webhook Widget
Menu Next departures

Example

Next departures

Three buses with live countdowns.

gridtimersymbol
Next departures
json
{
  "v": 1,
  "preferredFamily": "systemMedium",
  "refresh": 300,
  "accessibility": "Bus 42 to Kings Cross in 6 minutes, 17 to Angel in 14, 214 to Highgate Village in 23",
  "url": "https://tfl.gov.uk",
  "view": {
    "type": "vstack",
    "spacing": 10,
    "padding": 14,
    "bg": "#121319",
    "children": [
      {
        "type": "hstack",
        "spacing": 6,
        "children": [
          {
            "type": "symbol",
            "name": "bus.fill",
            "style": "caption",
            "color": "#8E8E93"
          },
          {
            "type": "text",
            "text": "Camden Road",
            "style": "caption",
            "weight": "semibold",
            "color": "#8E8E93"
          },
          {"type": "spacer"},
          {
            "type": "text",
            "text": "Southbound",
            "style": "caption",
            "color": "#8E8E93"
          }
        ]
      },
      {
        "type": "grid",
        "spacing": 10,
        "rowSpacing": 7,
        "columns": [{}, {"w": "fill"}, {"align": "trailing"}],
        "rows": [
          [
            {
              "type": "text",
              "text": "42",
              "size": 15,
              "weight": "bold",
              "color": "white",
              "align": "center",
              "minW": 36,
              "padding": {"top": 3, "bottom": 3, "leading": 6, "trailing": 6},
              "bg": "#E4322B",
              "corner": 6
            },
            {
              "type": "text",
              "text": "Kings Cross",
              "style": "headline",
              "color": "white",
              "lines": 1
            },
            {
              "type": "timer",
              "until": "2026-08-11T08:46:00Z",
              "size": 20,
              "weight": "semibold",
              "color": "white"
            }
          ],
          [
            {
              "type": "text",
              "text": "17",
              "size": 15,
              "weight": "bold",
              "color": "white",
              "align": "center",
              "minW": 36,
              "padding": {"top": 3, "bottom": 3, "leading": 6, "trailing": 6},
              "bg": "#2B6FE4",
              "corner": 6
            },
            {
              "type": "text",
              "text": "Angel",
              "style": "headline",
              "color": "white",
              "lines": 1
            },
            {
              "type": "timer",
              "until": "2026-08-11T08:54:00Z",
              "size": 20,
              "weight": "semibold",
              "color": "white"
            }
          ],
          [
            {
              "type": "text",
              "text": "214",
              "size": 15,
              "weight": "bold",
              "color": "white",
              "align": "center",
              "minW": 36,
              "padding": {"top": 3, "bottom": 3, "leading": 6, "trailing": 6},
              "bg": "#2B6FE4",
              "corner": 6
            },
            {
              "type": "text",
              "text": "Highgate Village",
              "style": "headline",
              "color": "#B4B4BC",
              "lines": 1
            },
            {
              "type": "timer",
              "until": "2026-08-11T09:03:00Z",
              "size": 20,
              "weight": "semibold",
              "color": "#B4B4BC"
            }
          ]
        ]
      }
    ]
  }
}
This payload is for the medium size. The larger sizes show the same payload with empty space around it. For a smaller size, the server sends a different payload.

How it works

The departures are a grid with three columns: route, destination, countdown. The route column is as wide as its widest badge, so the badges align. The destination column takes the remaining width and is truncated first. The countdowns are in their own column at the right edge.

Each route badge is a text with a bg, a corner and padding. A background is the same size as its node, so the badge is the size of its number plus the padding. minW sets a minimum width, so a one-digit badge is not narrower than the others.

The countdowns are timer nodes. They continue to count on the phone between fetches, so the widget stays correct for the five minutes until its next fetch. See timelines and refreshes.

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/departures

Open the payload →

Next

Server health: CPU, memory, disk and load.
All examples