Leather wallet widget
Tactile skeuomorphic cardholder with procedural leather grain, spring-animated payment cards, and dual-tone balance typography.
- Dependencies (1)
Overview and background
The leather wallet widget brings physical luxury goods craftsmanship to financial technology dashboards. Crafted around a multi-layered procedural SVG noise and specular lighting filter, the component reproduces authentic pebbled, matte, and obsidian leather grain textures without heavy image assets. Layered credit and merchant account cards rest inside a recessed chamber, sliding upward with physics-based spring trajectories when hovered or tapped. The front leather pocket features a symmetrical center thumb notch and a dual-tone tabular currency readout that splits significant thousands and decimal cents for immediate visual hierarchy.
Features
- Procedural leather grain textures: SVG turbulence and specular light filters generate realistic leather grain across pebbled, matte, and obsidian finishes.
- Physical spring animations: Cards respond with fluid spring physics on hover and selection using
motion/react. - Dual-tone currency readout: Clear financial typography featuring primary bold numerals and muted trailing thousands and cents.
- Interactive account isolation: Clicking any card isolates its individual account balance with an instant reset button.
- Zero image dependencies: Vector wordmarks for major payment providers (Stripe, PayPal, and custom text badges) render crisp SVGs at any resolution.
- Accessible motion fallbacks: Automatically respects
prefers-reduced-motionsettings by replacing vertical translation with instant color and outline indicators.
Use cases
- Fintech dashboards and bank portals: Main wallet balance summary widget for modern banking, neobank, or SaaS financial applications.
- Payment gateway status cards: Multi-provider merchant balance overview showing Stripe, PayPal, or Mercury deposits.
- Billing and subscription managers: Clean visual cardholder for managing linked payout cards and default settlement methods.
- Personal portfolio widgets: Interactive tactile component highlighting skeuomorphic design craft on creative portfolio sites.
Installation
pnpm dlx shadcn@latest add @abushaidislam/leather-wallet-widget
Usage
import LeatherWalletWidget, {
type WalletAccountCard,
} from "@/components/leather-wallet-widget"const cards: WalletAccountCard[] = [
{
id: "stripe",
name: "Stripe",
balance: 84500,
accentColor: "#6372E8",
textColor: "#FFFFFF",
logo: "stripe",
last4: "4821",
status: "Connected",
},
{
id: "paypal",
name: "PayPal",
balance: 35500,
accentColor: "#FFFFFF",
textColor: "#0F172A",
logo: "paypal",
last4: "9034",
status: "Verified",
},
]
export default function WalletPage() {
return (
<div className="flex min-h-[440px] items-center justify-center p-6">
<LeatherWalletWidget
cards={cards}
currencySymbol="$"
balanceLabel="Total balance"
interactive={true}
leatherFinish="pebbled"
/>
</div>
)
}Composition
Use the following composition to build a LeatherWalletWidget
LeatherWalletWidget
└── ProceduralFilterDefinitions (feTurbulence + feSpecularLighting)
└── OuterLeatherFrame (Rim lighting + grain overlay)
└── RecessedCardChamber
├── StackedPaymentCards (motion.button with spring physics)
│ ├── AccountStatus / Last4
│ └── BrandWordmark (Stripe / PayPal / Custom)
├── FrontPocketOverlay (SVG notch clipPath + grain filter)
│ └── BalanceReadoutBlock
│ ├── DualToneCurrencyHeading
│ └── AccountLabel & ResetToggle
└── InnerPerimeterRimShadowAPI reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
cards | WalletAccountCard[] | DEFAULT_CARDS | Array of up to 3 payment cards displayed inside the wallet chamber. |
currencySymbol | string | "$" | Symbol prefixed to balances (e.g. $, €, £, ¥). |
balanceLabel | string | "Total Balance" | Label shown beneath the aggregate balance readout. |
totalBalanceOverride | number | undefined | Optional balance override bypassing the automatic sum of card balances. |
selectedCardId | string | null | undefined | Controlled ID of the currently selected active card. |
onCardSelect | (card: WalletAccountCard | null) => void | undefined | Callback fired when a card is selected or deselected. |
interactive | boolean | true | When false, disables hover lifts and selection clicks. |
showCents | boolean | false | Whether to display fractional cent amounts (e.g. .00). |
leatherFinish | "pebbled" | "matte" | "obsidian" | "pebbled" | Texture profile adjusting filter intensity and chassis tones. |
className | string | undefined | Additional CSS classes applied to the outer container. |
WalletAccountCard
| Property | Type | Description |
|---|---|---|
id | string | Unique identifier for the card item. |
name | string | Display name of the account or issuer. |
balance | number | Numeric account balance in dollars or local units. |
accentColor | string | Background color for the card surface. |
textColor | string? | Optional text color (defaults to white). |
logo | "stripe" | "paypal" | "mercury" | "custom" | Vector brand logo displayed in the top right corner. |
customBadge | string? | Custom text badge rendered when logo is set to "custom". |
last4 | string? | Last 4 digits of the card account (e.g. "4821"). |
status | string? | Status text displayed when no last4 is provided. |
Accessibility
- The root element uses
role="region"witharia-labelannouncing the active account and current balance. - Card triggers are accessible
<button>elements witharia-pressedreflecting selection state. - Screen readers receive complete formatted balance descriptions through
aria-labelon each card button. - Full keyboard focusability with visible high-contrast focus rings (
focus-visible:ring-2 focus-visible:ring-white/80). - Supports
prefers-reduced-motion: spring translations are disabled, using instantaneous opacity and selection feedback instead.
Frequently asked questions
Does the leather grain effect degrade rendering performance?
No. The procedural SVG filter uses hardware-accelerated GPU primitives (feTurbulence and feSpecularLighting) cached to an off-screen surface. Because the filter parameters are static after mount, scrolling and card animations run smoothly at 60fps without CPU repainting.
Can I use custom brand colors and logos?
Yes. Each card in the cards array accepts arbitrary accentColor and textColor values (hex, rgb, or hsl). For institutions other than Stripe and PayPal, set logo="custom" and supply a customBadge string.
How are balances calculated when multiple cards are present?
By default, the wallet sums the balance property across all cards. When a user clicks an individual card, the balance readout animates to that card's specific balance and reveals an "All accounts" button to return to the aggregate total. You can also pass totalBalanceOverride to display custom calculated balances.
License and usage
- Free to use and modify in both personal and commercial projects.
- Attribution is appreciated but not required.
- Released under the MIT License.