A2UI Example: A Trip Planner Built with the Basic Catalog

A2UI is an open protocol created by Google that lets an AI agent show real interface. This example shows how far you can go with its Basic Catalog, the standard set of 18 components and 14 functions. Unofficial, and not affiliated with Google.

Try it

Say where you are going and on which dates, or leave Lisbon as it is. Each number marks a part of the screen, and the list names it and links to its page. The bar shows where the time went, in the order it happened.

No script? The parts, the numbers and a sample message are below.

The parts

One request for Oslo, 3 days (Basic components only, text version) produced 32 parts, all from the Basic Catalog:

Basic components in the trip planner (text version)
ComponentPartsWhat it does here
Text17the title, the dates line, the place description, the section headings, each day's date, temperatures and rain chance, and the local time
Row4one row per day (date, temperature range, rain chance) and the row of two buttons
CheckBox4the packing checklist, one box per suggested item
Column2the stack that lays the brief out top to bottom (plus the outer wrapper)
Divider2the lines that separate the weather from the pack list
Button2Save plan and Change dates; pressing one sends an action to the agent
Card1the card that holds the whole brief

What the code does, in order

  1. Check the input: dates in the right order, no more than 7 days, none in the past.
  2. Notice a shared place name (for example Lapland) and ask which one you mean.
  3. Look the place up.
  4. Fetch the weather for your dates and a short description of the place, both at the same time.
  5. Choose forecast or the same dates last year, and build the packing list from rules.
  6. Build the card from Basic components and send it as an A2UI message.
  7. Your browser draws it with the official React renderer.

None of it needs a model. A model could be added at the front, to decide what to look up, or at the back, to word the result. The measured cost of the part we built is below.

The numbers

One request (Oslo, 3 days), one machine, measured on 2026-11-14. For comparison, the same weather card written by a model took 9.4 s and 10,570 input tokens in an earlier test (Express format, one run).

A sample message

Show the A2UI message for this card

Shown in full: every part, including the credit at the end. The credit line uses the Worker's current wording, added after this sample was recorded.

[
 {
  "version": "1.0",
  "createSurface": {
   "surfaceId": "demo",
   "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json",
   "components": [
    {
     "id": "root",
     "component": "Column",
     "children": [
      "card"
     ]
    },
    {
     "id": "card",
     "component": "Card",
     "child": "col"
    },
    {
     "id": "t_title",
     "component": "Text",
     "text": "**Trip to Oslo, Norway**"
    },
    {
     "id": "t_dates",
     "component": "Text",
     "variant": "caption",
     "text": "Tue 17 Nov to Thu 19 Nov 2026, 3 days. Forecast."
    },
    {
     "id": "t_blurb",
     "component": "Text",
     "variant": "caption",
     "text": "Oslo is the capital and largest city of Norway. (Wikipedia, CC BY-SA 4.0)"
    },
    {
     "id": "d1",
     "component": "Divider"
    },
    {
     "id": "t_wx",
     "component": "Text",
     "variant": "caption",
     "text": "Weather"
    },
    {
     "id": "row0",
     "component": "Row",
     "justify": "spaceBetween",
     "children": [
      "row0a",
      "row0b",
      "row0c"
     ]
    },
    {
     "id": "row0a",
     "component": "Text",
     "text": "**TUE 17 NOV**"
    },
    {
     "id": "row0b",
     "component": "Text",
     "text": "-4° to 1°"
    },
    {
     "id": "row0c",
     "component": "Text",
     "variant": "caption",
     "text": "53% rain"
    },
    {
     "id": "row1",
     "component": "Row",
     "justify": "spaceBetween",
     "children": [
      "row1a",
      "row1b",
      "row1c"
     ]
    },
    {
     "id": "row1a",
     "component": "Text",
     "text": "**WED 18 NOV**"
    },
    {
     "id": "row1b",
     "component": "Text",
     "text": "-7° to -4°"
    },
    {
     "id": "row1c",
     "component": "Text",
     "variant": "caption",
     "text": "12% rain"
    },
    {
     "id": "row2",
     "component": "Row",
     "justify": "spaceBetween",
     "children": [
      "row2a",
      "row2b",
      "row2c"
     ]
    },
    {
     "id": "row2a",
     "component": "Text",
     "text": "**THU 19 NOV**"
    },
    {
     "id": "row2b",
     "component": "Text",
     "text": "-8° to -5°"
    },
    {
     "id": "row2c",
     "component": "Text",
     "variant": "caption",
     "text": "14% rain"
    },
    {
     "id": "d2",
     "component": "Divider"
    },
    {
     "id": "t_pack",
     "component": "Text",
     "variant": "caption",
     "text": "Pack"
    },
    {
     "id": "pk0",
     "component": "CheckBox",
     "label": "Comfortable walking shoes",
     "value": false
    },
    {
     "id": "pk1",
     "component": "CheckBox",
     "label": "Warm coat, hat and gloves",
     "value": false
    },
    {
     "id": "pk2",
     "component": "CheckBox",
     "label": "Umbrella or a rain jacket",
     "value": false
    },
    {
     "id": "pk3",
     "component": "CheckBox",
     "label": "Phone charger and a travel adapter",
     "value": false
    },
    {
     "id": "t_time",
     "component": "Text",
     "variant": "caption",
     "text": "Local time now: 16:08 (UTC+1)"
    },
    {
     "id": "actions",
     "component": "Row",
     "children": [
      "save",
      "chg"
     ]
    },
    {
     "id": "save",
     "component": "Button",
     "variant": "primary",
     "child": "save_t",
     "action": {
      "event": {
       "name": "save_plan",
       "context": {
        "destination": "Oslo, Norway",
        "from": "2026-11-17",
        "to": "2026-11-19"
       }
      }
     }
    },
    {
     "id": "save_t",
     "component": "Text",
     "text": "Save plan"
    },
    {
     "id": "chg",
     "component": "Button",
     "variant": "borderless",
     "child": "chg_t",
     "action": {
      "event": {
       "name": "change_dates"
      }
     }
    },
    {
     "id": "chg_t",
     "component": "Text",
     "text": "Change dates"
    },
    {
     "id": "col",
     "component": "Column",
     "children": [
      "t_title",
      "t_dates",
      "t_blurb",
      "d1",
      "t_wx",
      "row0",
      "row1",
      "row2",
      "d2",
      "t_pack",
      "pk0",
      "pk1",
      "pk2",
      "pk3",
      "t_time",
      "actions",
      "t_attr"
     ]
    },
    {
     "id": "t_attr",
     "component": "Text",
     "variant": "caption",
     "text": "Weather data by Open-Meteo.com (CC BY 4.0, https://creativecommons.org/licenses/by/4.0/), converted by us into daily summaries and packing suggestions. Place lookup: GeoNames (CC BY 4.0). Place description: the first two sentences of the Wikipedia article “Oslo” (https://en.wikipedia.org/wiki/Oslo), CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/), otherwise unchanged."
    }
   ]
  }
 }
]

Questions

What is an A2UI example?

It is a screen an agent builds by sending A2UI messages, drawn by a renderer. This one is a trip planner: you say where you are going and on which dates, and the agent sends a card with the weather for those dates, a short description of the place and a packing checklist.

Is this built only from the Basic Catalog?

Yes. The text version uses 7 of the 18 Basic components (Card, Column, Row, Text, Divider, CheckBox and Button), 32 parts in one request. The picture version is one Basic Image holding a drawn SVG.

Does it use a language model?

No. A small program on a Worker validates the dates, asks which place you mean when a name is shared, looks the place up, fetches the weather and a description at the same time, builds the packing list from rules and builds the card. In the request we measured it used 0 tokens.

Is this official A2UI documentation?

No. A2UI is an open protocol created by Google. This page is an unofficial example written to help people build with it, and we are not affiliated with Google.

Where does the data come from?

Weather comes from Open-Meteo (CC BY 4.0), the place lookup from GeoNames (CC BY 4.0) through Open-Meteo's geocoding service, and the place description from the Wikipedia article (CC BY-SA 4.0). The credit travels inside each message. Dates beyond the 16-day forecast use the same dates last year, and the page says so.

Next