0.0.12 • Published 3 years ago

@ohmunity/verification-code v0.0.12

Weekly downloads
54
License
MIT
Repository
github
Last release
3 years ago

Ohmunity


Simple Verification Code input for ReactJS

NPM Minified size Minzipped size License

Demo

Demo

Live demo coming soon

Install

npm install --save @ohmunity/verification-code

Usage

import React, { Component } from "react";

import VerificationCode from "@ohmunity/verification-code";

const App = () => {
  return <VerificationCode type="number" total={6} onComplete={console.log} />;
};

You can also Customize the input field

import React, { Component } from "react";

import VerificationCode from "@ohmunity/verification-code";

const App = () => {
  return (
    <VerificationCode
      type="number"
      total={6}
      onComplete={console.log}
      Component={React.forwardRef((props, ref) => (
        <FormField ref={ref} {...props} />
      ))}
    />
  );
};

Props

PropTypeDescription
type"number" | "string"input typerequired
totalnumbertotal of digitsrequired
valuestringdefault value
idstringelement id
placeholderstringelement placeholder (same for all)
disabledbooleanelement disabled status
requiredbooleanelement required status
onChangeFunctioncalls the function every time a field changes
onCompleteFunctioncall the function once all the fields are completed
ComponentReact Componentsupport for custom React Component
clearAfterCompletebooleanclear fields after completion

TODO

  • Add default styles and className support
  • Add tests
  • Add live demo

License

MIT © Ohmunity™

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago