0.0.2 • Published 6 years ago

@tammo/react-iban v0.0.2

Weekly downloads
240
License
MIT
Repository
github
Last release
6 years ago

react IBAN

travis ci build status

Input component for european IBAN numbers. It does format the user input to the human-machine readable format. It does not validate the IBAN.

install

yarn add @tammo/react-iban

changelog

  • v0.0.2
    • peer dependencies downgrade
  • v0.0.1
    • initial version

props

onChange - will receive the IBAN in machine readable form (no spaces). It will receive undefined, if the user removes all chars.

initialValue - to set the IBAN that is shown on first render.

All props will be passed down to the input element.

styling

There is no CSS. Please set your own classNames.

usage

Import default component:

import IBAN from '@tammo/react-iban'

You can calso use the formatting function. The function takes a string as the only parameter.

import { format } from '@tammo/react-iban'

output

A single input element:

<input type="text" size="27" />

example

As if the user would have input their IBAN. value is what onChange received and format used the exported format function.

screeshot of a filled IBAN input