npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@muhammedaksam/interactive-card

v1.0.4

Published

A beautiful, interactive payment card component for React applications

Downloads

7

Readme

React Interactive PayCard

npm version License: MIT TypeScript CI Coverage React

A beautiful, interactive payment card component for React applications.

Demo

Features

  • 🎨 Beautiful, realistic card design
  • 🔄 Interactive animations and transitions
  • 💳 Support for major card types (Visa, Mastercard, Amex, etc.)
  • 🌍 Multi-language support (English, Portuguese, Turkish)
  • 📱 Responsive design
  • 🔒 Card number masking/unmasking
  • ✅ Built-in validation
  • 🎭 Customizable backgrounds
  • 📦 TypeScript support
  • 🚀 Zero dependencies (except React)

Installation

pnpm add @muhammedaksam/interactive-card
# or
npm install @muhammedaksam/interactive-card
# or
yarn add @muhammedaksam/interactive-card

Important: Don't forget to import the CSS styles for the component to work properly!

Usage

Basic Usage

import React from 'react';
import { InteractivePayCard } from '@muhammedaksam/interactive-card';
import '@muhammedaksam/interactive-card/dist/style.css';

function App() {
  const handleSubmit = (cardData) => {
    console.log('Card data:', cardData);
  };

  return (
    <InteractivePayCard
      onSubmit={handleSubmit}
      locale="en"
    />
  );
}

Advanced Usage

import React from 'react';
import { InteractivePayCard } from '@muhammedaksam/interactive-card';
import '@muhammedaksam/interactive-card/dist/style.css';

function App() {
  const handleSubmit = (cardData) => {
    // Handle form submission
    console.log('Card data:', cardData);
  };

  return (
    <InteractivePayCard
      onSubmit={handleSubmit}
      locale="en"
      randomBackgrounds={false}
      backgroundImage="https://your-custom-background.jpg"
      initialData={{
        cardName: 'John Doe',
        cardNumber: '4111 1111 1111 1111'
      }}
      className="my-custom-class"
    />
  );
}

Using Individual Components

import React, { useState } from 'react';
import { PayCard } from '@muhammedaksam/interactive-card';
import '@muhammedaksam/interactive-card/dist/style.css';

function CustomForm() {
  const [cardData, setCardData] = useState({
    cardName: '',
    cardNumber: '',
    cardMonth: '',
    cardYear: '',
    cardCvv: ''
  });

  const fields = {
    cardNumber: 'card-number',
    cardName: 'card-name',
    cardMonth: 'card-month',
    cardYear: 'card-year',
    cardCvv: 'card-cvv'
  };

  return (
    <PayCard
      labels={cardData}
      fields={fields}
      isCardNumberMasked={false}
      locale="en"
    />
  );
}

Props

InteractivePayCard Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onSubmit | (data: CardFormData) => void | - | Callback function when form is submitted | | initialData | Partial<CardFormData> | {} | Initial form data | | locale | 'en' \| 'pt' \| 'tr' | 'en' | Language for labels and messages | | randomBackgrounds | boolean | true | Enable random background images | | backgroundImage | string | - | Custom background image URL | | className | string | '' | Additional CSS class |

PayCard Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | labels | CardFormData | - | Card data to display | | fields | object | - | Field ID mapping | | isCardNumberMasked | boolean | - | Whether to mask card number | | randomBackgrounds | boolean | true | Enable random backgrounds | | backgroundImage | string | - | Custom background image | | focusedField | string \| null | - | Currently focused field | | isCardFlipped | boolean | false | Whether card is flipped to show CVV | | locale | 'en' \| 'pt' \| 'tr' | 'en' | Display language |

Types

interface CardFormData {
  cardName: string;
  cardNumber: string;
  cardMonth: string;
  cardYear: string;
  cardCvv: string;
}

Supported Card Types

  • Visa
  • Mastercard
  • American Express
  • Discover
  • JCB
  • Diners Club
  • UnionPay
  • Troy

Development

Setup

# Clone the repository
git clone https://github.com/muhammedaksam/interactive-card.git
cd interactive-card

# Install dependencies
pnpm install

# Start development server
pnpm run dev

# Start Storybook for component development
pnpm run storybook

# Build for production
pnpm run build

# Build library
pnpm run build:lib

Building

The library can be built in two modes:

  • Development: pnpm run build - Creates a demo application
  • Library: pnpm run build:lib - Creates the npm package
  • Storybook: pnpm run storybook - Starts Storybook for component development and testing

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT © Muhammed Mustafa AKŞAM

Credits

Inspired by the original Vue.js component by muhammed.