0.0.12 • Published 4 years ago

@ohmunity/verification-code v0.0.12

Weekly downloads
54
License
MIT
Repository
github
Last release
4 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

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago