@tammo/react-iban
v0.0.2
Published
React component to input IBAN numbers
Downloads
9
Readme
react IBAN
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.