0.0.6 • Published 2 years ago

use-fancy-input v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

use-fancy-input

React hook for building fancy input for things like OTP, 2FA Code, etc.

Documentation is 🚧 but the hook is 🚀

⚠️ API will be stable after v1.0.0 until then consider it not production ready.

Demo

Source code behind the GIF above

import { useFancyInput } from "use-fancy-input";

const MyComponent = () => {
    const { containerRef, inputs } = useFancyInput({ length: 5 });

    return (
        <StyledDiv ref={containerRef}>
            {inputs.map((input) => {
                return <StyledInput {...input.getInputProps()} />;
            })}
        </StyledDiv>
    );
};

Installation

npm install use-fancy-input

OR

yarn add use-fancy-input
0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago