react-ir-banks-logo
v1.0.3
Published
A React component that returns logos of Iranian banks based on card number.
Downloads
5
Maintainers
Readme
react-ir-banks-logo
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
| - |