devfolioco / React Otp Input
Licence: mit
✔️ OTP Input Component for React
Stars: ✭ 177
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to React Otp Input
Vue Plyr
A Vue component for the plyr (https://github.com/sampotts/plyr) video & audio player.
Stars: ✭ 531 (+200%)
Mutual labels: hacktoberfest, component
Pdfvuer
A PDF viewer for Vue using Mozilla's PDF.js
Stars: ✭ 443 (+150.28%)
Mutual labels: hacktoberfest, component
V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (+6.21%)
Mutual labels: hacktoberfest, component
React Accessible Accordion
Accessible Accordion component for React
Stars: ✭ 610 (+244.63%)
Mutual labels: hacktoberfest, component
Ngx Ui
🚀 Style and Component Library for Angular
Stars: ✭ 534 (+201.69%)
Mutual labels: hacktoberfest, component
React Countdown
A customizable countdown component for React.
Stars: ✭ 402 (+127.12%)
Mutual labels: hacktoberfest, component
Memento
Simple + Powerful interface to the Mnesia Distributed Database 💾
Stars: ✭ 597 (+237.29%)
Mutual labels: hacktoberfest, otp
Orbit
React components of open-source Orbit design system by Kiwi.com
Stars: ✭ 774 (+337.29%)
Mutual labels: hacktoberfest, component
React Spring Slider
A slider component for react
Stars: ✭ 118 (-33.33%)
Mutual labels: hacktoberfest, component
Ivre
Network recon framework, published by @cea-sec & @ANSSI-FR. Build your own, self-hosted and fully-controlled alternatives to Shodan / ZoomEye / Censys and GreyNoise, run your Passive DNS service, collect and analyse network intelligence from your sensors, and much more!
Stars: ✭ 2,331 (+1216.95%)
Mutual labels: hacktoberfest
Mattermost Android Classic
Mattermost app for Android phones and tablets
Stars: ✭ 176 (-0.56%)
Mutual labels: hacktoberfest
Shopyo
🎁 Your Open web framework, designed with big in mind. Flask with Django advantages. Build your management systems, ERP products & mobile backend (coming soon). Small business needs apps included by default. First timers friendly. Email: [email protected] | password: pass
Stars: ✭ 172 (-2.82%)
Mutual labels: hacktoberfest
Pact Ruby
Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
Stars: ✭ 2,075 (+1072.32%)
Mutual labels: hacktoberfest
Netflix Migrate
A command-line tool to migrate data to and from Netflix profiles
Stars: ✭ 175 (-1.13%)
Mutual labels: hacktoberfest
React Component Echarts
React component echarts. 组件式百度图表。
Stars: ✭ 175 (-1.13%)
Mutual labels: component
Operators
Collection of Kubernetes Operators built with KUDO.
Stars: ✭ 175 (-1.13%)
Mutual labels: hacktoberfest
Tamburetei
Fazendo de tamburete as cadeiras de [email protected]
Stars: ✭ 177 (+0%)
Mutual labels: hacktoberfest
react-otp-input
A fully customizable, one-time password input component for the web built with React.
Installation
To install the latest stable version:
npm install --save react-otp-input
Basic usage:
import React, { Component } from 'react';
import OtpInput from 'react-otp-input';
export default class App extends Component {
state = { otp: '' };
handleChange = otp => this.setState({ otp });
render() {
return (
<OtpInput
value={this.state.otp}
onChange={this.handleChange}
numInputs={6}
separator={<span>-</span>}
/>
);
}
}
API
Name |
Type | Required | Default | Description |
---|---|---|---|---|
numInputs | number | true | 4 | Number of OTP inputs to be rendered. |
onChange | function | true | console.log | Returns OTP code typed in inputs. |
value | string / number | true | '' | The value of the OTP passed into the component. |
placeholder | string | false | none | Specify an expected value of each input. The length of this string should be equal to numInputs . |
separator | component |
false | none | Provide a custom separator between inputs by passing a component. For instance, <span>-</span> would add - between each input. |
containerStyle | style (object) / className (string) | false | none | Style applied or class passed to container of inputs. |
inputStyle | style (object) / className (string) | false | none | Style applied or class passed to each input. |
focusStyle | style (object) / className (string) | false | none | Style applied or class passed to inputs on focus. |
isDisabled | boolean | false | false | Disables all the inputs. |
disabledStyle | style (object) / className (string) | false | none | Style applied or class passed to each input when disabled. |
hasErrored | boolean | false | false | Indicates there is an error in the inputs. |
errorStyle | style (object) / className (string) | false | none | Style applied or class passed to each input when errored. |
shouldAutoFocus | boolean | false | false | Auto focuses input on initial page load. |
isInputNum | boolean | false | false | Restrict input to only numbers. |
isInputSecure | boolean | false | false | Masks input characters. |
Breaking changes when porting to v1.0.0
react-otp-input
is now a controlled component to facilitate functionalities that weren't possible before from the application using it, such as clearing or pre-assigning values. For v1.0.0
and above, a value
prop needs to be passed in the component for it to function as expected.
Development
To run the development server:
npm run dev
Checklist
- [x] Add flowtypes
- [x] Add ESLint, Prettier for code quality
- [x] Add styling support for states including focus/disabled
- [ ] Travis CI, Codecov
- [ ] Write tests
- [ ] Improve Documentation
Contributing
Feel free to open issues and pull requests!
License
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Abhishek Warokar 💻 🎨 🚧 🤔 👀 |
Aj 💻 🎨 🤔 |
Aromal Anil 💻 🔧 |
Gabriele Corti 💻 ️️️️♿️ |
Anoop 💻 |
Dewansh Rawat 🐛 |
Ishan Chhabra 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].