Command Palette

Search for a command to run...

0GitHub stars
Components

Leather wallet widget

Tactile skeuomorphic cardholder with procedural leather grain, spring-animated payment cards, and dual-tone balance typography.

Loading…
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-motion settings 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
        └── InnerPerimeterRimShadow

API reference

Props

PropTypeDefaultDescription
cardsWalletAccountCard[]DEFAULT_CARDSArray of up to 3 payment cards displayed inside the wallet chamber.
currencySymbolstring"$"Symbol prefixed to balances (e.g. $, €, £, ¥).
balanceLabelstring"Total Balance"Label shown beneath the aggregate balance readout.
totalBalanceOverridenumberundefinedOptional balance override bypassing the automatic sum of card balances.
selectedCardIdstring | nullundefinedControlled ID of the currently selected active card.
onCardSelect(card: WalletAccountCard | null) => voidundefinedCallback fired when a card is selected or deselected.
interactivebooleantrueWhen false, disables hover lifts and selection clicks.
showCentsbooleanfalseWhether to display fractional cent amounts (e.g. .00).
leatherFinish"pebbled" | "matte" | "obsidian""pebbled"Texture profile adjusting filter intensity and chassis tones.
classNamestringundefinedAdditional CSS classes applied to the outer container.

WalletAccountCard

PropertyTypeDescription
idstringUnique identifier for the card item.
namestringDisplay name of the account or issuer.
balancenumberNumeric account balance in dollars or local units.
accentColorstringBackground color for the card surface.
textColorstring?Optional text color (defaults to white).
logo"stripe" | "paypal" | "mercury" | "custom"Vector brand logo displayed in the top right corner.
customBadgestring?Custom text badge rendered when logo is set to "custom".
last4string?Last 4 digits of the card account (e.g. "4821").
statusstring?Status text displayed when no last4 is provided.

Accessibility

  • The root element uses role="region" with aria-label announcing the active account and current balance.
  • Card triggers are accessible <button> elements with aria-pressed reflecting selection state.
  • Screen readers receive complete formatted balance descriptions through aria-label on 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.

Was this helpful?

Command Palette

Search for a command to run...