Wallet Card
Wallet Card: Wallet overview card with an account switcher and search that morph open from their triggers, a cascading balance with a live change pill and privacy toggle, copy-address, and Send / Deposit / Swap / Buy actions. Free MIT React & Next.js source with Motion and Tailwind CSS, live preview, CLI install and docs.
Install Wallet Card
npx motion-ui-skill add wallet-cardComponents install as source into your project. The interactive page also includes preview, code, documentation and install tabs.
Dependencies
clsxlucide-reactmotionreacttailwind-merge
Source files
components/motion/wallet-card/index.tsxcomponents/motion/action-swap.tsxcomponents/motion/button/base.tsxcomponents/motion/button/index.tsxcomponents/motion/button/magnetic.tsxcomponents/motion/button/metallic.tsxcomponents/motion/button/stateful.tsxcomponents/motion/magnetic.tsxcomponents/motion/wallet-card/account-avatar.tsxcomponents/motion/wallet-card/account-switcher.tsxcomponents/motion/wallet-card/actions.tsxcomponents/motion/wallet-card/balance-delta.tsxcomponents/motion/wallet-card/constants.tscomponents/motion/wallet-card/copy-button.tsxcomponents/motion/wallet-card/search-bar.tsxcomponents/motion/wallet-card/types.tscomponents/motion/wallet-card/utils.tslib/ease.tslib/hooks/use-dismiss.tslib/hooks/use-hover-capable.tslib/utils.ts
Wallet Card
Wallet overview card with an account switcher and search that morph open from their triggers, a cascading balance with a live change pill and privacy toggle, copy-address, and Send / Deposit / Swap / Buy actions.
Install
npx motion-ui-skill add wallet-card
Dependencies
clsxlucide-reactmotionreacttailwind-merge
Usage
"use client";
import { useState } from "react";
import { WalletCard } from "@/components/motion/wallet-card";
import { Button } from "@/components/motion/button";
const ACCOUNTS = [
{ id: "main", name: "Main Wallet", address: "0x8f3Cb1a29e4D7c6F1B2a3E9d0C4b5A6f7D8e9C0b" },
{ id: "trading", name: "Trading", address: "0x1a2B3c4D5e6F7a8B9c0D1e2F3a4B5c6D7e8F9a0B" },
{ id: "cold", name: "Cold Storage", address: "0x9F8e7D6c5B4a3E2d1C0b9A8f7E6d5C4b3A2e1F0d" },
];
const RECENT_SEARCHES = ["vitalik.eth", "0xA0b8…6EB4", "Uniswap", "Send to Trading"];
export function WalletCardPreview() {
const [balance, setBalance] = useState(12480.32);
return (
<div className="flex w-full flex-col items-center gap-4 p-6">
<WalletCard
accounts={ACCOUNTS}
balance={balance}
defaultChange={124.5}
searchRecent={RECENT_SEARCHES}
hasNotifications
/>
<Button
variant="ghost"
size="sm"
onClick={() => setBalance((b) => b + (Math.random() > 0.5 ? 1 : -1) * (50 + Math.random() * 400))}
>
Simulate balance change
</Button>
</div>
);
}
API Reference
WalletCard
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
accounts |
WalletAccount[] |
— | Yes | — |
accountId |
string |
— | No | — |
defaultAccountId |
string |
— | No | — |
onAccountChange |
((id: string) => void) |
— | No | — |
balance |
number |
— | Yes | — |
balancePrefix |
string |
$ |
No | — |
defaultChange |
number |
— | No | Initial balance change shown in the pill before any live change. |
defaultBalanceHidden |
boolean |
false |
No | Start with the balance hidden behind dots. |
onSend |
(() => void) |
— | No | — |
onDeposit |
(() => void) |
— | No | — |
onSwap |
(() => void) |
— | No | — |
onBuy |
(() => void) |
— | No | — |
searchPlaceholder |
string |
— | No | — |
searchRecent |
string[] |
— | No | Recent searches shown in the expanded search panel. |
onSearchChange |
((value: string) => void) |
— | No | — |
onSearchSubmit |
((value: string) => void) |
— | No | — |
hasNotifications |
boolean |
false |
No | Show an unread pulse on the notifications bell. |
onNotifications |
(() => void) |
— | No | — |
className |
string |
— | No | — |