Compute and format

Functions

These functions are part of the Basic Catalog in Google's A2UI v1.0 protocol. This page shows how they behave so you can build with them. Unofficial, and not affiliated with Google.

Locale en-US. Times follow the browser timezone; the timezone of the recorded run was not logged. Media and links use example.invalid placeholders.

Compute and format functions: stored SDK reference beside official React renderer output
FunctionExample argumentsExpected (SDK reference)ObservedResult

required

Checks that the value is not null, undefined, or empty.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: value. Returns validationResult.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": "x"}disabled=False (valid=True)disabled=FalsePASS
{"value": ""}disabled=True (valid=False)disabled=TruePASS
Try your own arguments for required

regex

Checks that the value matches a regular expression string.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: pattern, value. Returns validationResult.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": "abc", "pattern": "^[a-z]+$"}disabled=False (valid=True)disabled=FalsePASS
{"value": "ABC", "pattern": "^[a-z]+$"}disabled=True (valid=False)disabled=TruePASS
Try your own arguments for regex

length

Checks string length constraints.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: max, min, value. Returns validationResult.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": "abcd", "min": 3, "max": 5}disabled=False (valid=True)disabled=FalsePASS
{"value": "ab", "min": 3}disabled=True (valid=False)disabled=TruePASS
Try your own arguments for length

numeric

Checks numeric range constraints.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: max, min, value. Returns validationResult.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": 5, "min": 1, "max": 10}disabled=False (valid=True)disabled=FalsePASS
{"value": 11, "min": 1, "max": 10}disabled=True (valid=False)disabled=TruePASS
Try your own arguments for numeric

email

Checks that the value is a valid email address.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: value. Returns validationResult.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": "a@b.co"}disabled=False (valid=True)disabled=FalsePASS
{"value": "nope"}disabled=True (valid=False)disabled=TruePASS
Try your own arguments for email

and

Performs a logical AND operation on a list of boolean values.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: values. Returns boolean.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"values": [true, true]}disabled=False (valid=True)disabled=FalsePASS
{"values": [true, false]}disabled=True (valid=False)disabled=TruePASS
Try your own arguments for and

or

Performs a logical OR operation on a list of boolean values.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: values. Returns boolean.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"values": [false, false]}disabled=True (valid=False)disabled=TruePASS
{"values": [false, true]}disabled=False (valid=True)disabled=FalsePASS
Try your own arguments for or

not

Performs a logical NOT operation on a boolean value.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: value. Returns boolean.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": true}disabled=True (valid=False)disabled=TruePASS
{"value": false}disabled=False (valid=True)disabled=FalsePASS
Try your own arguments for not

formatString

Performs string interpolation of data model values and other functions in the catalog functions list and returns the resulting string. The value string can contain interpolated expressions in the `${expression}` format. Supported expression types include: JSON Pointer paths to the data model (e.g.,
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: value. Returns string.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
Hi ${/name}, ${/age} with /name Ada, /age 36, then /name BobHi Ada, 36 then Hi Bob, 36Hi Ada, 36 then Hi Bob, 36PASS
formatString with model interpolation; update model, text followsinterpolation follows the modelPASS
Try your own arguments for formatString

formatNumber

Formats a number with the specified grouping and decimal precision.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: decimals, grouping, value. Returns string.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": 1234567.891, "decimals": 2, "grouping": true}1,234,567.891,234,567.89PASS
{"value": 1234567.891, "decimals": 0, "grouping": false}12345681234568PASS
formatNumber, formatCurrency, formatDate together on one valueformatNumber, formatCurrency, formatDate match the SDK referencePASS
Try your own arguments for formatNumber

formatCurrency

Formats a number as a currency string.
Arguments and evidence

DIFF React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: currency, decimals, grouping, value. Returns string.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

Findings

  • formatCurrency(1234.5, EUR, 0 decimals): the SDK reference gives 1,234 (an exact half rounds to even) and React gives 1,235. The spec states no rounding mode. The cause was inferred, not verified.
  • For 1234.5 EUR with 0 decimals the SDK reference (Python, Babel) gives €1,234 and the React renderer (browser Intl) gives €1,235. Measured cause: Babel rounds exact halves to even, Intl rounds them away from zero (checked on 1233.5, 1234.5 and 1235.5, and Intl with roundingMode halfEven gives €1,234). The implementation guide says to use the platform's native formatting and names no rounding rule, so neither is called wrong. Source: guide in the saved upstream copy (the current v1.0 spec, identical to a2ui.org), read 14 Nov 2026.

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": 1234.5, "currency": "USD"}$1,234.50$1,234.50PASS
{"value": 1234.5, "currency": "EUR", "decimals": 0}€1,234€1,235
Expected and observed differ; see the note under the table.
DIFF
Try your own arguments for formatCurrency

formatDate

Formats a timestamp into a string using a pattern.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: format, value. Returns string.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": "2026-11-14T10:00:00Z", "format": "yyyy-MM-dd"}2026-11-142026-11-14PASS
{"value": "2026-11-14T10:00:00Z", "format": "MMM d, yyyy"}Nov 14, 2026Nov 14, 2026PASS
Try your own arguments for formatDate

pluralize

Returns a localized string based on the Common Locale Data Repository (CLDR) plural category of the count (zero, one, two, few, many, other). Requires an 'other' fallback. For English, just use 'one' and 'other'.
Arguments and evidence

PASS React 0.15.0 with web_core 0.15.0, v1.0 module · headless Chromium, Linux · 2026-11-14 · 1 run

Arguments: few, many, one, other, two, value, zero. Returns string.

[
  {
    "version": "1.0",
    "createSurface": {
      "surfaceId": "demo",
      "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json"
    }
  }
]

What is not claimed

  • Other renderers (Lit, Angular, community) were not rerun; the 8 November 2026 matrix stands.
  • Gemini Enterprise was not tested in this run (14 November 2026).
  • Remote media was not loaded, so media records element creation and attributes, not playback.
  • Layout and visual quality are not judged.
{"value": 1, "one": "item", "other": "items"}itemitemPASS
{"value": 2, "one": "item", "other": "items"}itemsitemsPASS
{"value": 0, "zero": "none", "one": "item", "other": "items"}nonenonePASS
pluralize one/other; model 1 -> 2one then otherPASS
Try your own arguments for pluralize

DIFF in formatCurrency: for {"value": 1234.5, "currency": "EUR", "decimals": 0} the SDK reference gives €1,234 and the browser, through the renderer, gives €1,235. The cause is how an exact half is rounded: the Python library the SDK uses rounds half to even (1234.5 gives 1,234; 1235.5 gives 1,236), while the browser rounds half away from zero (1234.5 gives 1,235). The specification guide says to use the platform's native number formatting and does not name a rounding rule, so we do not call either one wrong.