Santiago Llorach

Payment Method Selector

Forms

About

Animated payment-method selector — radio group with motion stagger, gold accent on selected, support for disabled rows (coming-soon methods). Works controlled or uncontrolled. Drop-in for checkout flows.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Payment Method Selector to your project and fits it to your theme.

Code

How Payment Method Selector is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { useState } from "react";
import { CreditCard, Smartphone, Store, Mail } from "lucide-react";
import PaymentMethodSelector, { type PaymentMethod } from "@/components/ui/paymentmethodselector";

type MethodId = "card" | "apple_pay" | "in_store" | "email_link";

const METHODS: PaymentMethod[] = [
  {
    id: "card",
    icon: <CreditCard className="h-5 w-5" />,
    label: "Credit or debit card",
    description: "Visa, Mastercard, Amex",
  },
  {
    id: "apple_pay",
    icon: <Smartphone className="h-5 w-5" />,
    label: "Apple Pay / Google Pay",
    description: "One-tap from your device",
    disabled: true,
  },
  {
    id: "in_store",
    icon: <Store className="h-5 w-5" />,
    label: "Reserve & pay in store",
    description: "Hold for 7 days · pay in person",
  },
  {
    id: "email_link",
    icon: <Mail className="h-5 w-5" />,
    label: "Email me a payment link",
    description: "We'll follow up personally",
  },
];

export default function PaymentMethodSelectorDemo() {
  const [method, setMethod] = useState<MethodId>("card");
  return (
    <div className="mx-auto max-w-md">
      <PaymentMethodSelector
        title="Payment"
        methods={METHODS}
        selectedId={method}
        onSelectionChange={(id) => setMethod(id as MethodId)}
      />
    </div>
  );
}

Dependencies

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 1

    Login 1

    52
  • Authentication Card

    Authentication Card

    47
  • Book A Demo 3

    Book A Demo 3

    83
  • Book A Demo 1

    Book A Demo 1

    69
  • Contact Card

    Contact Card

    1K
  • Login Card

    Login Card

    32
  • Login 2

    Login 2

    7