Simple Verification Code input for ReactJS
npm install @ohmunity/verification-code---
> Simple Verification Code input for ReactJS
 !Minified size !Minzipped size !License
!Demo
Live demo coming soon
``bash`
npm install --save @ohmunity/verification-code
`jsx
import React, { Component } from "react";
import VerificationCode from "@ohmunity/verification-code";
const App = () => {
return
};
`
You can also Customize the input field
`jsx
import React, { Component } from "react";
import VerificationCode from "@ohmunity/verification-code";
const App = () => {
return (
total={6}
onComplete={console.log}
Component={React.forwardRef((props, ref) => (
))}
/>
);
};
`
| Prop | Type | Description | |
| ------------------ | -------------------- | --------------------------------------------------- | -------- |
| type | "number" \| "string" | input type | required |
| total | number | total of digits | required |
| value | string | default value | |
| id | string | element id | |
| placeholder | string | element placeholder (same for all) | |
| disabled | boolean | element disabled status | |
| required | boolean | element required status | |
| onChange | Function | calls the function every time a field changes | |
| onComplete | Function | call the function once all the fields are completed | |
| Component | React Component | support for custom React Component | |
| clearAfterComplete | boolean | clear fields after completion | |
- [ ] Add default styles and className` support
- [ ] Add tests
- [ ] Add live demo
MIT © Ohmunity™