Mahmoud Ilyan

Radio Card

Component

About

A card-style radio button group for single-selection choices, supporting an optional icon, label, description and trailing addon per option.

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

Code

How Radio Card is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { RadioCard, RadioCardItem } from "@/components/ui/radio-card";
import { MdCreditCard, MdAccountBalance, MdPayment } from "react-icons/md";

export default function RadioCardPaymentDemo() {
  return (
    <RadioCard defaultValue="card" className="max-w-md">
      <RadioCardItem
        value="card"
        icon={<MdCreditCard className="size-5 text-icon" />}
        label="Credit Card"
        description="Visa, Mastercard, Amex"
        addon={
          <span className="text-xs text-ink-muted">Processing fee: 2.9%</span>
        }
      />
      <RadioCardItem
        value="bank"
        icon={<MdAccountBalance className="size-5 text-icon" />}
        label="Bank Transfer"
        description="Direct ACH payment"
        addon={<span className="text-xs text-ink-muted">No fee</span>}
      />
      <RadioCardItem
        value="paypal"
        icon={<MdPayment className="size-5 text-icon" />}
        label="PayPal"
        description="Pay with PayPal balance"
        addon={
          <span className="text-xs text-ink-muted">Processing fee: 3.4%</span>
        }
      />
    </RadioCard>
  );
}

Dependencies

More by Mahmoud Ilyan

View all
  • Switch

    Switch

  • Segmented Control

    Segmented Control

  • Checkbox

    Checkbox

  • Avatar

    Avatar