Skip to Content
TensorPass
Guides

Theming

Match the connect window to your design system with the CSS tokens of @aiconnect/design, in light and dark, and in right to left languages.

The connect window of @aiconnect/react reads its colors, font, radius and width from CSS custom properties named --aic-*. They come from @aiconnect/design, and @aiconnect/react/styles.css includes them. You theme the window by setting these properties in your own stylesheet.

Set your tokens

Write the tokens you want to change on :root, in a stylesheet loaded after @aiconnect/react/styles.css. When both rules have the same specificity, the later one wins.

import '@aiconnect/react/styles.css';
import './aiConnectTheme.css';

Taamtaam's theme sets its font and its warm palette:

aiConnectTheme.css
/* The AI Wallet connect window in TaamTaam's palette. */
:root {
  --aic-font: var(--font-montserrat), sans-serif;
  --aic-ink: #2f2b22;
  --aic-muted: #5c5544;
  --aic-surface: #ffffff;
  --aic-ground: #f7f5f0;
  --aic-border: #e2ddd1;
  --aic-accent: #6f6754;
  --aic-accent-ink: #ffffff;
  --aic-danger: #b3261e;
}

You can also set the tokens on any element that wraps the provider, to theme one part of the page.

The tokens

TokenLightDarkWhat it styles
--aic-fontinheritinheritThe font of the whole window.
--aic-ink#0b0d12#f3f4f6Titles, body text and the help link.
--aic-muted#5e636d#9aa0aaHints, the help screen's list and the close button.
--aic-surface#ffffff#17181dThe card's background.
--aic-ground#f6f7f9#0e0f13The close button's background.
--aic-border#e6e8ec#2a2c33The card's border and the help link's underline.
--aic-accent#0b0d12#f3f4f6The main button's background.
--aic-accent-ink#ffffff#0e0f13The main button's text.
--aic-cyan#0ab9f7#0ab9f7The wallet mark in the disc, the inner arcs and the disc's border while the wallet waits for the visitor.
--aic-cyan-soft#7fddfb#7fddfbThe disc's border at rest and the middle arcs while the wallet waits.
--aic-cyan-faint#cff4fc#0f3a49The arcs at rest.
--aic-halo#e3f8fd#0c2a35The halo around the disc.
--aic-focus#0ab9f7#0ab9f7The focus ring of buttons and links.
--aic-backdroprgba(11, 13, 18, 0.42)rgba(0, 0, 0, 0.6)The layer behind the card, which also blurs the page.
--aic-shadow0 24px 64px rgba(11, 13, 18, 0.2)0 24px 64px rgba(0, 0, 0, 0.55)The card's shadow.
--aic-radius24px24pxThe card's corner radius.
--aic-width380px380pxThe card's width, capped to the viewport.
--aic-danger#c4321f#ff8a7aPart of the token set. The connect window's styles do not read it in this release.

The cyan tokens draw AI Wallet's mark in its ring, the same mark the wallet itself shows. The disc at the center of the ring keeps a white background in both palettes.

Dark mode

The light palette applies by default. An element with data-aic-theme="dark" gives the window under it the dark palette, and data-aic-theme="auto" follows the system setting.

The connect window renders inside AiConnectProvider, right after its children. Put the attribute on an element that contains the provider, such as <html>:

app/layout.tsx
<html lang="en" data-aic-theme="auto">

When your site has its own dark mode switch, set the attribute from it, or skip the attribute and write the dark values under your own dark selector:

aiConnectTheme.css
:root {
  --aic-ink: #2f2b22;
  --aic-surface: #ffffff;
  --aic-accent: #6f6754;
}

/* The site puts class="dark" on <html> in dark mode. */
.dark {
  --aic-ink: #f1ede4;
  --aic-surface: #1d1b17;
  --aic-accent: #d8cfba;
  color-scheme: dark;
}

Right to left

The window's reading direction comes from the dir field of its messages. The built in Hebrew messages set dir: 'rtl':

<AiConnectProvider client={client} locale="he">

The provider puts dir on the window's outer element, so the layout mirrors and the help screen's list indents from the right. When you pass your own messages, set dir to match their language. Pick a --aic-font with Hebrew glyphs, or keep inherit when your page font has them.

Motion

The window fades in, the card rises, and the arcs pulse while the wallet waits for the visitor. Under prefers-reduced-motion: reduce these animations are off.

On this page