Webhook Widget
Menu Weather

Example

Weather

Conditions now and the next six hours.

symbolfillequal columns
Weather
json
{
  "v": 1,
  "preferredFamily": "systemMedium",
  "refresh": 1800,
  "accessibility": "London, 18 degrees, partly cloudy. High 21, low 12. Rain from early evening.",
  "url": "https://weather.example.com/london",
  "view": {
    "type": "vstack",
    "spacing": 0,
    "padding": {"top": 14, "bottom": 12, "leading": 16, "trailing": 16},
    "bg": "#2E66AE",
    "text": {"color": "white"},
    "children": [
      {
        "type": "hstack",
        "align": "top",
        "children": [
          {
            "type": "vstack",
            "align": "leading",
            "spacing": -4,
            "children": [
              {
                "type": "hstack",
                "spacing": 4,
                "children": [
                  {"type": "text", "text": "London", "style": "headline"},
                  {"type": "symbol", "name": "location.fill", "size": 11}
                ]
              },
              {"type": "text", "text": "18°", "size": 44, "weight": "light"}
            ]
          },
          {"type": "spacer"},
          {
            "type": "vstack",
            "align": "trailing",
            "spacing": 2,
            "children": [
              {
                "type": "symbol",
                "name": "cloud.sun.fill",
                "size": 20,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "Partly Cloudy",
                "style": "caption",
                "weight": "semibold"
              },
              {
                "type": "text",
                "text": "H:21° L:12°",
                "style": "caption",
                "weight": "semibold"
              }
            ]
          }
        ]
      },
      {"type": "spacer"},
      {
        "type": "hstack",
        "spacing": 0,
        "children": [
          {
            "type": "vstack",
            "spacing": 5,
            "w": "fill",
            "children": [
              {
                "type": "text",
                "text": "Now",
                "style": "caption2",
                "weight": "semibold",
                "color": "white/80"
              },
              {
                "type": "symbol",
                "name": "cloud.sun.fill",
                "size": 17,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "18°",
                "style": "footnote",
                "weight": "semibold"
              }
            ]
          },
          {
            "type": "vstack",
            "spacing": 5,
            "w": "fill",
            "children": [
              {
                "type": "text",
                "text": "09",
                "style": "caption2",
                "weight": "semibold",
                "color": "white/80"
              },
              {
                "type": "symbol",
                "name": "cloud.sun.fill",
                "size": 17,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "19°",
                "style": "footnote",
                "weight": "semibold"
              }
            ]
          },
          {
            "type": "vstack",
            "spacing": 5,
            "w": "fill",
            "children": [
              {
                "type": "text",
                "text": "10",
                "style": "caption2",
                "weight": "semibold",
                "color": "white/80"
              },
              {
                "type": "symbol",
                "name": "sun.max.fill",
                "size": 17,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "20°",
                "style": "footnote",
                "weight": "semibold"
              }
            ]
          },
          {
            "type": "vstack",
            "spacing": 5,
            "w": "fill",
            "children": [
              {
                "type": "text",
                "text": "11",
                "style": "caption2",
                "weight": "semibold",
                "color": "white/80"
              },
              {
                "type": "symbol",
                "name": "sun.max.fill",
                "size": 17,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "20°",
                "style": "footnote",
                "weight": "semibold"
              }
            ]
          },
          {
            "type": "vstack",
            "spacing": 5,
            "w": "fill",
            "children": [
              {
                "type": "text",
                "text": "12",
                "style": "caption2",
                "weight": "semibold",
                "color": "white/80"
              },
              {
                "type": "symbol",
                "name": "cloud.fill",
                "size": 17,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "18°",
                "style": "footnote",
                "weight": "semibold"
              }
            ]
          },
          {
            "type": "vstack",
            "spacing": 5,
            "w": "fill",
            "children": [
              {
                "type": "text",
                "text": "13",
                "style": "caption2",
                "weight": "semibold",
                "color": "white/80"
              },
              {
                "type": "symbol",
                "name": "cloud.rain.fill",
                "size": 17,
                "mode": "multicolor"
              },
              {
                "type": "text",
                "text": "16°",
                "style": "footnote",
                "weight": "semibold"
              }
            ]
          }
        ]
      }
    ]
  }
}
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 hourly forecast is six vstacks, each with "w": "fill". Children that fill share the row equally, so the six columns have the same width for any content.

Each icon is a symbol: an SF Symbol name that the phone draws in the weight and colour of the text near it. mode: "multicolor" makes the sun yellow on the phone. The preview here cannot draw Apple's symbols, so it shows the nearest open-licence icon. See the note under the node reference.

The large temperature has size: 42 and weight: "light". A fixed size does not follow Dynamic Type. Use one only for the main number. The other text uses text styles, so it follows the person's text size.

The background is one hex colour, so the widget looks the same in light and dark. white text stays white on a light Home Screen.

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

Open the payload →

Next

Parcel delivery: An arrival window with a live progress bar.
All examples