Skip to main content
Start with AomiWidget, then take ownership of more of the interface only when your product needs it.

Choose your customization level

Configure AomiWidget

Use presentation props to fit the widget into a page, panel, or modal.
These props change presentation. The Application ID selects the deployed App; action review and wallet execution remain visible client responsibilities.

Apply themes and styles

Import the default stylesheet once:
Then override its CSS variables in your application stylesheet. Keep transaction warnings, fees, owner addresses, and confirmation states visually distinct when changing colors.

Compose with AomiFrame

Use the compound API when the standard widget layout is close to what you need, but you want to rearrange its sections.
AomiFrame provides the chat surface and runtime. If you use it outside AomiWidget, your application must supply the surrounding authentication and account integration.

Own the source with shadcn

Copy the widget components into your repository when you need to change markup or component behavior:
Copied components become application code. Review registry updates before overwriting local changes.

Build a headless UI

Choose the headless library when props, themes, composition, and copied components are not enough. Aomi continues to provide thread, chat, user, event, notification, and wallet-request state. You provide every visible interaction.

Install the library

Add the runtime provider

Your responsibilities

A headless interface must provide:
  • Thread navigation and message rendering.
  • Composer, streaming, cancellation, and error states.
  • Wallet connection and network selection.
  • Transaction-call and fee disclosure.
  • Explicit approval and rejection controls.
  • Owner and network validation before signing.
  • Submitted, confirmed, expired, and failed operation states.
Returning a generic transaction result is not enough. Your interface must narrow each action by action.request.kind, show the exact request, and return the result that kind expects. Prefer AomiWidget unless you need to own the full approval experience.

Hooks

All hooks must run beneath AomiRuntimeProvider.

Chat and threads

Read active-thread messages with useAomiRuntime().getMessages().

User and wallet controls

Events and notifications

Read ordered backend events from useAomiRuntime().events and the active lifecycle from turnState. pendingActions contains canonical Actions; narrow on action.request.kind before reading its payload. Use the exported TypeScript types as the source of truth for complete signatures and payloads.

Complete custom UI example

This starter owns message rendering, the composer, cancellation, and the visible wallet-request count:
Add an approval component for every action kind your App can produce. Show the calls, signatures, owner, network, simulation evidence, and terminal status available on the request.
Last modified on August 31, 2026