react-pinify
v0.2.0
Published
React-Pinify: Simplifying secure PIN input for React applications effortlessly.
Downloads
18
Maintainers
Readme
react-pinify
Simplifying secure PIN input for React applications effortlessly
Usage
npm i react-pinify
import {usePinify, Pinify, Underlined} from 'react-pinify'
const App = () => {
const pinify = usePinify();
const formSubmitHandler = () => {
try {
const val = pinify.submitEventHandler()
console.log(val)
}
catch (e) {
console.error(e)
}
}
return <>
<Pinify
reference={pinify.ref}
onChange={pinify.valueChangeHandler}
defaultStyles = {Underlined}
/>
<button onClick={formSubmitHandler}>Submit</button>
{/*JSX*/}
</>
}