Wobble Wallet

A wallet-style card stack with wobbly, jelly-like edges. Cards stack like a wallet, lift on hover, squash on press, and spring open into an expanded card with the rest piling up below. The wobble is spring-driven on the card outline, so it interrupts and re-triggers smoothly.

Gallery day pass

Casa da Luz, Lisbon

ENTRY

11:00

GATE

A

DATE

Fri 24 Oct

GUESTS

2

Gallery ticket artworkGAL-0211

Night Market Live

Riverside Pavilion

DOORS

19:30

DATE

Fri 24 Oct

SECTION

Floor

GATE

C

Night market artworkNML-0424

River ferry

Cais do Sodre to Cacilhas

BOARDS

17:10

PIER

2

RETURN

Open

FARE

Adult

PIER

2

RETURN

18:40

FARE

Adult

Rail pass

Zone 1-2, all day

VALID

Oct 24

ROUTE

Loop

FARE

Adult

ZONE

1-2

FIRST

07:00

LAST

23:30

Installation

  1. 1

    Install the component:

    npx shadcn@latest add https://ui.amines.fun/registry/wobble-wallet.json
  2. 2

    Usage:

    jsx

    app/page.jsx

    <WobbleWallet  cards={[    {      id: "rail",      title: "Rail pass",      subtitle: "Zone 1-2, all day",      icon: <TrainFront />,      color: "#FFC21A",      badge: { label: "VALID", value: "Oct 24" },      details: [        { label: "ROUTE", value: "Central loop" },        { label: "FARE", value: "Adult" },      ],    },    {      id: "ferry",      title: "River ferry",      subtitle: "Cais do Sodre to Cacilhas",      icon: <Ship />,      color: "#00C2A8",      badge: { label: "BOARDS", value: "17:10" },      preview: [        { label: "PIER", value: "2" },        { label: "RETURN", value: "Open" },      ],    },  ]}/>

Props

PropTypeDefaultDescriptionRequired
cardsArray<card>[]Card objects to stack. Required for anything to render. Each card supports: id (string | number, falls back to index), title, subtitle, icon (ReactNode, SVGs auto-size to 20px), color (any CSS color for the card body), textColor, iconBackground, iconColor, badge ({ label, value } top-right), preview ([{ label, value }] row on the front stacked card), details ([{ label, value }] row when open), and content (ReactNode shown below details when open — QR code, image, button, anything). The LAST card in the array is the front card of the stack.No
widthnumber340Max width in pixels. The wallet fills its parent up to this width.No
cardHeightnumber150Height of a card in the stack in pixels.No
peeknumber70Visible header strip of each stacked card in pixels; also the header height inside an open card.No
expandedHeightnumber320Height of the opened card in pixels. Increase it for taller content.No
radiusnumber24Corner radius in pixels.No
hoverLiftnumber12Pixels a card lifts on hover. Set 0 to disable.No
pileStepnumber10Vertical offset between pile cards under an opened card, in pixels.No
pileGapnumber12Gap between the opened card and the pile, in pixels.No
pileHeightnumber44Height of each pile card in pixels.No
wobblenumber1Wobble strength multiplier. 1 is about 1-3px of edge movement (subtle), 0 disables, 2 doubles it.No
wobbleStiffnessnumber320Spring stiffness of the wobble. Higher settles faster.No
wobbleDampingnumber18Spring damping of the wobble. Lower adds more wobble cycles; 14-24 stays tasteful.No
spring{ type: "spring"; stiffness: number; damping: number }{ type: "spring", stiffness: 220, damping: 28 }Motion transition for moving and resizing cards.No
textColorstring"#0A0A0A"Default text colour on cards. A card's textColor overrides it. Accepts any CSS colour including var().No
iconBackgroundstring"#0A0A0A"Default icon tile background. A card's iconBackground overrides it.No
selectedIdstring | number | nullundefined (uncontrolled)Controlled id of the open card. Pass null for none and pair with onSelectedChange.No
defaultSelectedIdstring | number | nullnullId of the card that starts open in uncontrolled mode.No
onSelectedChange(id | null) => voidundefinedCalled with the card id when a card opens, or null when it closes.No
showCloseButtonbooleantrueShow the round close button above the opened card.No
closeOnEscapebooleantrueClose the opened card when Escape is pressed.No
shadowClassNamestring"drop-shadow-[0_-6px_14px_rgba(0,0,0,0.3)]"Tailwind classes for the card shadow. Pass an empty string to remove it.No
classNamestring""Extra classes for the root element.No
cardClassNamestring""Extra classes for each card's content layer.No
closeButtonClassNamestring""Extra classes for the close button.No