{description}
+ )} + +No messages yet. Start a conversation!
+{content.data.text}
; + } + + if (content.variant === "a2ui_data_part") { + return ( +{JSON.stringify(content.data, null, 2)};
+}
diff --git a/samples/client/react/projects/a2a-chat-canvas/src/components/index.ts b/samples/client/react/projects/a2a-chat-canvas/src/components/index.ts
new file mode 100644
index 00000000..eea2d3b6
--- /dev/null
+++ b/samples/client/react/projects/a2a-chat-canvas/src/components/index.ts
@@ -0,0 +1,22 @@
+/*
+ Copyright 2025 Google LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+export { A2aChatCanvas } from "./A2aChatCanvas";
+export { Chat } from "./Chat";
+export { ChatHistory } from "./ChatHistory";
+export { InputArea } from "./InputArea";
+export { Canvas } from "./Canvas";
+export { Message } from "./Message";
diff --git a/samples/client/react/projects/a2a-chat-canvas/src/context/ChatContext.tsx b/samples/client/react/projects/a2a-chat-canvas/src/context/ChatContext.tsx
new file mode 100644
index 00000000..c1424257
--- /dev/null
+++ b/samples/client/react/projects/a2a-chat-canvas/src/context/ChatContext.tsx
@@ -0,0 +1,339 @@
+/*
+ Copyright 2025 Google LLC
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+import {
+ createContext,
+ useContext,
+ useState,
+ useCallback,
+ useRef,
+ useMemo,
+ useEffect,
+ ReactNode,
+} from "react";
+import { useA2UI } from "@a2ui/react";
+import { Types } from "@a2ui/lit/0.8";
+import { A2AClient } from "@a2a-js/sdk/client";
+import {
+ MessageSendParams,
+ SendMessageSuccessResponse,
+ Task,
+ AgentCard,
+ Part,
+} from "@a2a-js/sdk";
+import { v4 as uuid } from "uuid";
+import {
+ UiMessage,
+ UiMessageContent,
+ UiAgent,
+ ChatServiceState,
+ CanvasServiceState,
+ A2AService,
+} from "../types";
+import {
+ extractA2aPartsFromResponse,
+ extractA2uiDataParts,
+ convertPartToUiMessageContent,
+} from "../utils";
+
+interface ChatContextValue {
+ chat: ChatServiceState;
+ canvas: CanvasServiceState;
+ agentCard: { name: string; iconUrl?: string } | null;
+ a2uiSurfaces: ReadonlyMap{sample.description}
+{getJson(sample.surface)}
+ {getJson(sample.surface)}
+ + I coordinate multiple agents to help you accomplish complex tasks. Just + describe what you need, and I'll route your request to the right + agents. +
+
+ + I help you understand and visualize sales pipelines and analyze customer + performance data. +
+ +No chart data available
+Google Maps API key not configured.
++ Set VITE_GOOGLE_MAPS_API_KEY in your environment. +
+ {pins.length > 0 && ( +