Theme Toggle

Floating light/dark theme switch persisted per visitor.

Surfaces
google-apps-script-webmcp-apps
Fields
FieldType
initialstring. "dark" or "light" — which state the toggle (and its label/chrome) paints as on first load. Not itself persistence — a surface that repaints itself (e.g. via paint_result) must pass the reader's LAST choice back in here, or every repaint resets to whatever this says.optional
positionstring (optional, default "bottom-right")optional
dark_bgstring (optional, hex, default "#0f172a")optional
label_darkstring (optional, default "🌙")optional
label_lightstring (optional, default "☀️")optional
persist_tostring. A ValueStore primitive's id — when set together with persist_action, a click ALSO calls the engine directly (bypassing the standard wire-prop system, which has no event carrying "which theme it became") to set this ValueStore to "dark"/"light" and run persist_action. Omit either and the toggle is purely visual, as before.optional
persist_actionstring. An action id to run right after persist_to is set — typically one that saves it server-side. See persist_to.optional
Example payload
{
  "type": "theme_toggle"
}
ARD catalog entry
{
  "identifier": "urn:air:a2uicatalog.ai:atom:theme_toggle",
  "displayName": "Theme Toggle",
  "type": "application/vnd.a2ui.atom+json",
  "url": "https://a2uicatalog.ai/atoms/theme_toggle",
  "capabilities": [
    "google-apps-script-web",
    "mcp-apps"
  ],
  "description": "Floating light/dark theme switch persisted per visitor.",
  "representativeQueries": [
    "show a floating light dark theme switch",
    "floating light/dark theme switch persisted per visitor.",
    "render a theme toggle"
  ]
}
← Full ARD catalog
Deploy your own Google Apps Script renderer

The renderer is an open-source Google Apps Script web app. Deploy your own instance in 4 commands — you own the URL, no dependency on the demo endpoint.

git clone https://github.com/a2uicatalog/a2ui
cd a2ui/apps-script-surface/gas-wired-renderer
clasp push && clasp deploy
Full deploy guide →