Skip to content

Commit 3da39b7

Browse files
author
ugogo
committed
prepare v0.1.0
1 parent b36e23c commit 3da39b7

File tree

10 files changed

+62
-221
lines changed

10 files changed

+62
-221
lines changed

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,42 @@
11
# react-verification-code
22

3-
> Made with create-react-library
3+
A verification code input, autocompletion friendly
44

55
[![NPM](https://img.shields.io/npm/v/react-verification-code.svg)](https://www.npmjs.com/package/react-verification-code) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
66

7+
## Examples
8+
9+
- Basic - [CodeSandbox](https://codesandbox.io/s/basic-6ejdp) - [Source](https://github.com/ugogo/react-verification-code/tree/master/example/src/Basic.tsx)
10+
711
## Install
812

913
```bash
1014
npm install --save react-verification-code
1115
```
1216

17+
```bash
18+
yarn add react-verification-code
19+
```
20+
1321
## Usage
1422

1523
```tsx
16-
import React, { Component } from 'react'
17-
18-
import MyComponent from 'react-verification-code'
19-
import 'react-verification-code/dist/index.css'
24+
import * as React from 'react';
25+
import ReactVerificationCode from 'react-verification-code';
26+
import 'react-verification-code/dist/index.css';
2027

21-
class Example extends Component {
22-
render() {
23-
return <MyComponent />
24-
}
28+
export default function App() {
29+
return <ReactVerificationCode />;
2530
}
2631
```
2732

33+
## API
34+
35+
| Key | Type | Default | Description |
36+
| ----------- | --------- | ------- | ------------------------------- |
37+
| length | `number` | `4` | How many items will be rendered |
38+
| placeholder | `Element` | `·` | Element rendered when no value |
39+
2840
## License
2941

3042
MIT © [ugogo](https://github.com/ugogo)

example/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
"eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject"
1111
},
1212
"dependencies": {
13-
"@testing-library/jest-dom": "link:../node_modules/@testing-library/jest-dom",
14-
"@testing-library/react": "link:../node_modules/@testing-library/react",
15-
"@testing-library/user-event": "link:../node_modules/@testing-library/user-event",
16-
"@types/jest": "link:../node_modules/@types/jest",
17-
"@types/node": "link:../node_modules/@types/node",
1813
"@types/react": "link:../node_modules/@types/react",
1914
"@types/react-dom": "link:../node_modules/@types/react-dom",
2015
"react": "link:../node_modules/react",

example/src/App.test.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

example/src/App.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

example/src/Basic.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as React from 'react';
2+
import ReactVerificationCode from 'react-verification-code';
3+
import 'react-verification-code/dist/index.css';
4+
5+
export default () => <ReactVerificationCode />;

example/src/index.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ body {
66
sans-serif;
77
-webkit-font-smoothing: antialiased;
88
-moz-osx-font-smoothing: grayscale;
9-
}
109

11-
code {
12-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
13-
monospace;
10+
height: 100vh;
11+
display: flex;
12+
justify-content: center;
13+
align-items: center;
1414
}

example/src/index.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
import './index.css';
1+
import * as React from 'react';
2+
import * as ReactDOM from 'react-dom';
23

3-
import React from 'react';
4-
import ReactDOM from 'react-dom';
5-
import App from './App';
4+
import BasicExample from './Basic';
5+
import './index.css';
66

7-
ReactDOM.render(<App />, document.getElementById('root'));
7+
ReactDOM.render(
8+
<>
9+
<BasicExample />
10+
</>,
11+
document.getElementById('root')
12+
);

example/src/setupTests.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)