1.0.6 • Published 2 years ago

tfa-input v1.0.6

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

NPM build status npm size npm downloads NPM

tfa-input

Tfa-input is a cool and customizable component built with TypeScript ready to drop in your projects.

Table of content

Built with

Installation

You can use npm

npm i tfa-input

or via Yarn

yarn add tfa-input

API

OptionTypeRequiredDefaultDescription
valuestring / numberfalse[]The value of the input passed into the component.
onSubmitfunctiontrueundefinedFunction called when the user filled in the code.
autoFocusbooleanfalsefalseOptional boolean param to control whether the input should be autofocused on mount.
containerStylestring (className) / object (style)falseStyle applied or class passed to container of cells.
cellNumberStylestring / objectfalseStyle applied or class passed to each cell.
inputStylestring / objectfalseStyle applied or class passed to input.
focusColorstringfalse#23d9d9Color of input cell on focus state.

Example of usage

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { TfaInput } from 'tfa-input';


const App = () => {
  return (
    <div>
      <TfaInput
        value={123456}
        autoFocus
        onSubmit={(code) => console.log(code)}
        containerStyle="container-classname"
        cellNumberStyle={{ fontSize: '26px'}}
      />
    </div>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

Contributing

GitHub issues GitHub pull requests

Feel free to open issues and pull requests!

License

This project is licensed under the terms of the MIT license.

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago