Skip to content

ehsan-shv/react-ir-banks-logo

Repository files navigation

react-ir-banks-logo

Version

A React component that returns logos of Iranian banks based on card number. Demo

Installation

npm i react-ir-banks-logo

Example

import { BankIcon } from 'react-ir-banks-logo';

function App() {
  const [digits, setDigits] = useState('');
  const [name, setName] = useState('');
  return (
    <div className="App">
      <input
        type="text"
        value={digits}
        onChange={e => setDigits(e.target.value)}
      />
      <BankIcon
        digits={digits}
        size="200px"
        margin="100px"
        onFindBankName={(name: string) => setName(name)}
      />
      <h1>{name}</h1>
    </div>
  );
}

Props

Props Value Type Default Value
digits string | number is required
size string '40px'
margin string '8px'
onFindBankName (name: string) => void -