Interface modules
Ready made AI interfaces for your site, already wired to the visitor's AI Wallet and to your MCP tools. A chat in a side panel, a popup, inline in the page, a full page AI mode, and a search bar that answers.
The interface modules are the AI features a site adds in a few lines, with no interface to build. Each one runs the conversation on the visitor's own AI through AI Wallet, calls your site's tools from your MCP server, and draws the whole exchange.
| Form | React | Web Component | Page |
|---|---|---|---|
| A chat docked in a side panel at the page's edge | AiChatPanel | <aiconnect-chat variant="panel"> | Side panel |
| A floating button that opens a chat popup | AiChatPopup | <aiconnect-chat variant="popup"> | Popup |
| A chat inline in the page | AiChatInline | <aiconnect-chat variant="inline"> | Inline chat |
| A full page AI mode | AiChatPage | <aiconnect-chat variant="page"> | Full page |
| A search bar that answers | AiSearch | <aiconnect-search> | Search bar |
The React components come with @aiconnect/react. The Web Components are the same modules in one script for sites without React, such as WordPress pages: see Web Components.
What every module does
- Streams the answer. The text appears as the visitor's model writes it, with a cyan caret at its end. Light Markdown (bold, lists, links, code) is drawn as formatting.
- Shows the tool calls as they run. Each call of one of your tools gets a row with a cyan light while it runs, a check once its result is back, and the arguments the model chose.
- Names the account that answers. The header shows the account and its model as the wallet reports them (
state.providerNameandstate.model), with the wallet's arcs lit while the answer streams. - Handles the connect and install steps. Until the visitor's AI is connected, the module shows the step the visitor is at: connect the wallet, add it to the browser, approve the site, or try again after a refusal. Its button opens the connect window. A question asked before the connection stays on screen and goes out once the wallet connects the site.
- Offers Stop. While an answer streams, the send button becomes Stop. Stopping ends the answer in the wallet too and keeps the text written so far.
- Follows your design system. Every color, the font, the radii and the sizes come from the
--aic-*tokens, in light, dark and right to left. See Theming the modules. - Speaks English, French and Hebrew. The provider's
localesets the language of the modules and of the connect window. Hebrew lays the module out right to left, and the side panel and the popup move to the left edge.
Quickstart
Install the packages and wrap your app in AiConnectProvider, as in the React quickstart. The stylesheet @aiconnect/react/styles.css carries the modules' styles with the connect window's.
npm install @aiconnect/core @aiconnect/reactThen render a module where it belongs. This popup answers from the tools of your MCP server:
import { AiChatPopup } from '@aiconnect/react';
const SYSTEM = 'You recommend books from this site\'s catalog. Always search the catalog before recommending.';
export function App() {
return (
<>
<YourSite />
<AiChatPopup system={SYSTEM} mcp="/api/mcp" suggestions={['A calm book for tonight']} />
</>
);
}import { AiConnect } from '@aiconnect/core';
import { AiConnectProvider } from '@aiconnect/react';
import '@aiconnect/react/styles.css';
const client = new AiConnect();
createRoot(document.getElementById('root')!).render(
<AiConnectProvider client={client} locale="en">
<App />
</AiConnectProvider>,
);The module needs nothing else: the visitor clicks the floating button, connects their AI from the popup the first time, and asks. A visitor who does not have the wallet yet gets a link to the AI Wallet page.
In a Next.js App Router site, render the modules from a client component inside your provider, as the Next.js quickstart does for the provider itself.
Props every module takes
Prop
Type
- system. The instructions the visitor's model gets before the first question: what the site is, which tools to use and how to answer.
- tools and mcp. Where your tools come from. Give one of them. Keep a
toolsobject stable across renders, for example by building it once outside the component. - title, intro and placeholder. Your own words for the header, for the heading of an empty conversation, and for the question box. Without them the module uses its built in copy in the provider's language.
- suggestions. Questions shown in an empty conversation, sent with one click.
- toolLabels. A plain name per tool, shown while it runs, such as
{ search_books: 'Searching the catalog' }. Without one, the row shows the tool's own name. - renderToolResults. Draws a turn's tool results your way. See Your own result cards.
The side panel, the popup and the full page also take how they open:
Prop
Type
Leave open out to let the module keep its state. Give open and onOpenChange to open it from your own button, and hideLauncher to hide the module's own.
Your own result cards
renderToolResults receives each turn, with the visitor's question, the answer so far and every tool call with its raw result, and returns what to draw under the answer. It runs again as the answer streams, so cards can follow the names the answer gives.
Taamtaam draws the restaurants its catalog search returned that the answer names, in the order the answer names them:
import type { ChatTurn } from '@aiconnect/react';
function renderRestaurants(turn: ChatTurn) {
const restaurants = suggestedRestaurants(turn);
if (restaurants.length === 0) {
return null;
}
return (
<ul className={styles.suggestions}>
{restaurants.map((restaurant) => <li key={restaurant.id}><RestaurantCard restaurant={restaurant} /></li>)}
</ul>
);
}
<AiChatPanel system={SYSTEM_PROMPT} mcp="/api/mcp" renderToolResults={renderRestaurants} />;The cards render inside the module, so your own stylesheet styles them.
Languages
AiConnectProvider takes locale (en, fr or he) for the connect window and the modules together. The modules' built in copy is builtInModuleMessages. Pass moduleMessages to the provider to write the whole copy yourself, and set its dir to rtl for a right to left language.
Prop
Type
The modules also show the connect window's own copy for the connection steps, from messages.
Theming the modules
The modules read the tokens of the theming guide and these ones of their own:
| Token | Light | Dark | What it styles |
|---|---|---|---|
--aic-mono | 'Reddit Mono', ui-monospace, monospace | same | Tool names, the model's name and code in answers. |
--aic-stripe | #15161a | #050506 | The stripe of the key card beside the account that answers. |
--aic-fill | ink at 7% over the surface | same rule | The visitor's question and the model's tag. Set it to override the mix. |
--aic-ink-2 | ink at 84% over the surface | same rule | The answer's text. Set it to override the mix. |
--aic-panel-width | 420px | same | The side panel's width. |
--aic-popup-width | 400px | same | The popup's width. |
--aic-popup-height | 640px | same | The popup's height. |
--aic-inline-height | 560px | same | The inline chat's height. |
--aic-page-width | 760px | same | The column of the full page mode. |
--aic-layer | 990 | same | The stacking level of the side panel, the popup, its button and the full page. The connect window sits at 1000, above them. |
--aic-fill and --aic-ink-2 are mixed from your --aic-ink and --aic-surface when you do not set them, so a site that sets its own palette gets matching shades. Dark mode follows data-aic-theme, as for the connect window.
Taamtaam's theme sets its font, its warm palette and a wider panel:
:root {
--aic-font: var(--font-montserrat), sans-serif;
--aic-ink: #2f2b22;
--aic-muted: #5c5544;
--aic-ground: #f7f5f0;
--aic-border: #e2ddd1;
--aic-accent: #6f6754;
--aic-panel-width: 440px;
}Next steps
- Pick a form: side panel, popup, inline chat, full page or search bar.
- Add the modules to a page without React with one script tag.
- Serve your tools with the MCP guide.