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.
Installation
Section titled “Installation”npx shadcn@latest add @0xui/add-tokenpnpm dlx shadcn@latest add @0xui/add-tokenyarn dlx shadcn@latest add @0xui/add-tokenbunx --bun shadcn@latest add @0xui/add-tokenimport { AddToken } from "@/components/add-token";
<AddToken token={{ address, symbol: "USDC", decimals: 6, logoURI }} />;States
Section titled “States”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”. |
