# A2UI 1.0 React ticket example

Run this example in a React TypeScript project. The demo replays local messages and needs no API key.

1. Install the pinned SDKs and apply the Markdown adapter overrides in your npm project.

   ```sh
   npm pkg set 'overrides.@a2ui/markdown-it.@a2ui/web_core=0.15.0'
   npm pkg set 'overrides.@a2ui/markdown-it.dompurify=3.4.17'
   npm install @a2ui/react@0.15.0 @a2ui/web_core@0.15.0 zod@3.25.76
   ```

2. Save `A2uiTicketDemo.tsx`, `ticket.module.css`, `catalog.json`, and `messages.json` in one directory. Use a build tool that supports CSS modules and JSON imports, such as Next.js or Vite.
3. Import the default export and render `<A2uiTicketDemo />`. In a Next.js project, add the component to a page. In a Vite React TypeScript project, render it from `src/App.tsx`.
4. Confirm the ticket, inspect the event and response, then switch themes. Reset the ticket to repeat the interaction.

The `create` and `confirm` properties in `messages.json` are separate protocol messages. The example uses the A2UI message processor and a local callback that stands in for the agent. The host applies theme variables independently of the messages. Use [AuraUI's Linear Design MD](https://www.auraui.cc/designs/linear) as a reference for the dark theme.
