Skip to content

Components

Add Token

Button that asks the wallet to track a token, e.g. "Add USDC to wallet".

Asks the wallet to track an ERC-20 (EIP-747). Useful after a swap or bridge into a token the wallet doesn’t list by default. Renders nothing when no wallet is connected.

Terminal window
npx shadcn@latest add @0xui/add-token
import { AddToken } from "@/components/add-token";
<AddToken token={{ address, symbol: "USDC", decimals: 6, logoURI }} />;
data-phase What the user sees
idle “Add USDC to wallet”
adding Spinner, “Confirm in your wallet.”
added Check, “USDC added” (disabled)
cancelled “Cancelled in wallet.” Not an error.
error The wallet doesn’t support adding tokens, or failed.

Also accepts shadcn Button props.

Prop Type Description
token { address, symbol, decimals, logoURI? } Token to add. Wallets show logoURI as its icon.
children ReactNode Label. Defaults to “Add <symbol> to wallet”.