Skip to Content

Components

Pre-built UI components for wallet interaction, transaction display, and account management.

EmbarkAI ships several ready-to-use React components alongside its hooks. All components respect the current theme and can be styled with the className prop.

Import

import { UserOpStatus, Hash, Address, TransactionsList, KeyshareBackup, ThemeToggle, LangToggle, } from '@embarkai/ui-kit'

ThemeToggle

A button that toggles between light and dark mode. Requires no props.

import { ThemeToggle } from '@embarkai/ui-kit' function Header() { return ( <nav> <ThemeToggle /> </nav> ) }

The toggle updates the color mode globally and persists the preference. See Theming for more details.

LangToggle

A dropdown selector for switching between available languages. Requires no props.

import { LangToggle } from '@embarkai/ui-kit' function Footer() { return ( <footer> <LangToggle /> </footer> ) }

The selected language is persisted to localStorage. See Internationalization for configuration details.

UserOpStatus

Displays a real-time status indicator for a submitted UserOperation. Internally polls the bundler and updates the UI as the operation moves through its lifecycle.

Props

PropTypeRequiredDescription
userOpHashstringYesThe UserOperation hash to track.
pollMsnumberNoPolling interval in ms. Default: 1000.
maxPollTimeMsnumberNoMax polling time in ms. Default: 60000.
onStateChange(state: UserOpState) => voidNoCallback on state transitions.
onReceipt(receipt) => voidNoCallback when included on-chain.
onTxHash(txHash: string) => voidNoCallback when tx hash is available.
classNamestringNoCSS class for the wrapper element.

Usage

import { useSendTransaction, UserOpStatus } from '@embarkai/ui-kit' function SendPanel() { const { sendTransaction, userOpHash } = useSendTransaction() return ( <div> <button onClick={() => sendTransaction({ to: '0x...', value: '0.1' })}> Send </button> {userOpHash && ( <UserOpStatus userOpHash={userOpHash} onStateChange={(state) => console.log(state)} /> )} </div> ) }

Hash

Renders a transaction or UserOperation hash with optional truncation and explorer link.

Props

PropTypeRequiredDescription
hashstringYesThe hash to display.
truncatebooleanNoTruncate the hash to 0x1234...abcd format. Default: true.
explorerstringNoBase URL for the block explorer. Renders the hash as a link.
classNamestringNoCSS class for the wrapper element.

Usage

import { Hash } from '@embarkai/ui-kit' <Hash hash="0xabc123def456..." truncate explorer="https://explorer.lumia.org/tx" />

Address

Renders a wallet address with optional truncation and explorer link.

Props

PropTypeRequiredDescription
addressstringYesThe wallet address to display.
truncatebooleanNoTruncate to 0x1234...abcd format. Default: true.
explorerstringNoBase URL for the block explorer. Renders the address as a link.
classNamestringNoCSS class for the wrapper element.

Usage

import { Address } from '@embarkai/ui-kit' <Address address="0x1234567890abcdef1234567890abcdef12345678" explorer="https://explorer.lumia.org/address" />

TransactionsList

Displays the recent transaction history for the connected wallet.

Props

PropTypeRequiredDescription
limitnumberNoMaximum number of transactions to show.
classNamestringNoCSS class for the wrapper element.

Usage

import { TransactionsList } from '@embarkai/ui-kit' function Activity() { return <TransactionsList limit={10} className="my-tx-list" /> }

KeyshareBackup

Renders a menu interface for managing keyshare backups. Keyshare backups allow users to recover their wallet if they lose access to their device.

import { KeyshareBackup } from '@embarkai/ui-kit' function SecuritySettings() { return ( <div> <h2>Backup</h2> <KeyshareBackup /> </div> ) }

Next Steps

Last updated on