Skip to content

Commit bd3518e

Browse files
committed
update readme
1 parent 68a5412 commit bd3518e

File tree

2 files changed

+16
-77
lines changed

2 files changed

+16
-77
lines changed

README.md

Lines changed: 11 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# react-otp-input
1+
# reactjs-otp-input
22

3-
[![npm version](https://badge.fury.io/js/react-otp-input.svg)](https://badge.fury.io/js/react-otp-input) [![npm](https://img.shields.io/npm/dw/react-otp-input.svg?logo=npm)](https://www.npmjs.com/package/react-otp-input) [![npm](https://img.shields.io/bundlephobia/minzip/react-otp-input)](https://www.npmjs.com/package/react-otp-input)
4-
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)
3+
[![npm version](https://badge.fury.io/js/reactjs-otp-input.svg)](https://badge.fury.io/js/reactjs-otp-input) [![npm](https://img.shields.io/npm/dw/reactjs-otp-input.svg?logo=npm)](https://www.npmjs.com/package/reactjs-otp-input) [![npm](https://img.shields.io/bundlephobia/minzip/reactjs-otp-input)](https://www.npmjs.com/package/reactjs-otp-input)
4+
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
55

66
<!-- ALL-CONTRIBUTORS-BADGE:END -->
77

@@ -15,12 +15,12 @@ A fully customizable, one-time password input component for the web built with R
1515

1616
## Installation
1717

18-
[![NPM](https://nodei.co/npm/react-otp-input.png?compact=true)](https://nodei.co/npm/react-otp-input/)
18+
[![NPM](https://nodei.co/npm/reactjs-otp-input.png?compact=true)](https://nodei.co/npm/reactjs-otp-input/)
1919

2020
#### To install the latest stable version:
2121

2222
```
23-
npm install --save react-otp-input
23+
npm install --save reactjs-otp-input
2424
```
2525

2626
#### Basic usage:
@@ -29,21 +29,12 @@ npm install --save react-otp-input
2929
import React, { Component } from 'react';
3030
import OtpInput from 'react-otp-input';
3131

32-
export default class App extends Component {
33-
state = { otp: '' };
34-
35-
handleChange = (otp) => this.setState({ otp });
36-
37-
render() {
38-
return (
39-
<OtpInput
40-
value={this.state.otp}
41-
onChange={this.handleChange}
42-
numInputs={6}
43-
separator={<span>-</span>}
44-
/>
45-
);
46-
}
32+
export default const App {
33+
const [otp, setOtp] = useState('');
34+
35+
const handleChange = (otp) => setOtp({ otp });
36+
37+
return <OtpInput value={otp} onChange={handleChange} numInputs={6} separator={<span>-</span>} />;
4738
}
4839
```
4940

@@ -178,62 +169,10 @@ export default class App extends Component {
178169
</tr>
179170
</table>
180171

181-
## Breaking changes when porting to v1.0.0
182-
183-
`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.
184-
185172
## Development
186173

187174
#### To run the development server:
188175

189176
```
190177
npm run dev
191178
```
192-
193-
## Checklist
194-
195-
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat&logo=github)](https://github.com/devfolioco/react-otp-input/pulls) [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/devfolioco/react-otp-input)
196-
197-
- [x] Add flowtypes
198-
- [x] Add ESLint, Prettier for code quality
199-
- [x] Add styling support for states including focus/disabled
200-
- [ ] Write tests
201-
202-
## Contributing
203-
204-
[![GitHub issues](https://img.shields.io/github/issues-raw/devfolioco/react-otp-input?logo=github)](https://github.com/devfolioco/react-otp-input/issues) [![GitHub pull requests](https://img.shields.io/github/issues-pr/devfolioco/react-otp-input?logo=git)](https://github.com/devfolioco/react-otp-input/pulls)
205-
206-
Feel free to open [issues](https://github.com/devfolioco/react-otp-input/issues/new/choose) and [pull requests](https://github.com/devfolioco/react-otp-input/pulls)!
207-
208-
## License
209-
210-
[![NPM](https://img.shields.io/npm/l/react-otp-input)](https://github.com/devfolioco/react-otp-input/blob/master/LICENSE)
211-
212-
## Contributors ✨
213-
214-
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
215-
216-
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
217-
<!-- prettier-ignore-start -->
218-
<!-- markdownlint-disable -->
219-
<table>
220-
<tr>
221-
<td align="center"><a href="https://github.com/apollonian"><img src="https://avatars2.githubusercontent.com/u/2150306?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Abhishek Warokar</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=apollonian" title="Code">💻</a> <a href="#design-apollonian" title="Design">🎨</a> <a href="#maintenance-apollonian" title="Maintenance">🚧</a> <a href="#ideas-apollonian" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/devfolioco/react-otp-input/pulls?q=is%3Apr+reviewed-by%3Aapollonian" title="Reviewed Pull Requests">👀</a></td>
222-
<td align="center"><a href="https://ajayns.me"><img src="https://avatars0.githubusercontent.com/u/20743219?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aj</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=ajayns" title="Code">💻</a> <a href="#design-ajayns" title="Design">🎨</a> <a href="#ideas-ajayns" title="Ideas, Planning, & Feedback">🤔</a></td>
223-
<td align="center"><a href="http://aromalanil.me"><img src="https://avatars1.githubusercontent.com/u/49222186?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Aromal Anil</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=aromalanil" title="Code">💻</a> <a href="#tool-aromalanil" title="Tools">🔧</a></td>
224-
<td align="center"><a href="https://borntofrappe.github.io"><img src="https://avatars0.githubusercontent.com/u/33316703?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gabriele Corti</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=borntofrappe" title="Code">💻</a> <a href="#a11y-borntofrappe" title="Accessibility">️️️️♿️</a></td>
225-
<td align="center"><a href="https://www.anoopms.me"><img src="https://avatars1.githubusercontent.com/u/46913894?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Anoop</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=anoopmsivadas" title="Code">💻</a></td>
226-
<td align="center"><a href="http://dewanshrawat.xyz"><img src="https://avatars0.githubusercontent.com/u/17003127?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dewansh Rawat</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/issues?q=author%3Adewanshrawat15" title="Bug reports">🐛</a></td>
227-
<td align="center"><a href="http://ishanchhabra.com"><img src="https://avatars3.githubusercontent.com/u/32290367?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ishan Chhabra</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=ishan-chhabra" title="Code">💻</a></td>
228-
</tr>
229-
<tr>
230-
<td align="center"><a href="http://www.causztic.com"><img src="https://avatars.githubusercontent.com/u/2081441?v=4?s=100" width="100px;" alt=""/><br /><sub><b>yaojie</b></sub></a><br /><a href="https://github.com/devfolioco/react-otp-input/commits?author=causztic" title="Code">💻</a></td>
231-
</tr>
232-
</table>
233-
234-
<!-- markdownlint-restore -->
235-
<!-- prettier-ignore-end -->
236-
237-
<!-- ALL-CONTRIBUTORS-LIST:END -->
238-
239-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-otp-input",
3-
"version": "2.4.0",
2+
"name": "reactjs-otp-input",
3+
"version": "1.0.1",
44
"description": "A fully customizable, one-time password input component for the web built with React",
55
"main": "lib/index.js",
66
"scripts": {
@@ -54,14 +54,14 @@
5454
"webpack-cli": "3.3.12",
5555
"webpack-dev-server": "3.11.2"
5656
},
57-
"author": "Devfolio <[email protected]> (https://devfolio.co)",
57+
"author": "",
5858
"license": "MIT",
5959
"homepage": "https://devfolioco.github.io/react-otp-input",
6060
"repository": {
6161
"type": "git",
62-
"url": "https://github.com/devfolioco/react-otp-input"
62+
"url": "https://github.com/hunghg255/react-otp-input"
6363
},
6464
"bugs": {
65-
"url": "https://github.com/devfolioco/react-otp-input/issues"
65+
"url": "https://github.com/hunghg255/react-otp-input/issues"
6666
}
6767
}

0 commit comments

Comments
 (0)