Skip to content

Commit f8dd4a1

Browse files
author
Konstantin Kulinicenko
committed
readme.md updated
1 parent b8947a6 commit f8dd4a1

File tree

8 files changed

+103
-7
lines changed

8 files changed

+103
-7
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
11
# react-code-input
22
React component for entering and validating code.
3+
4+
## Installation
5+
6+
`npm i --save react-code-input`
7+
8+
## Usage
9+
10+
### Nummeric input:
11+
![Nummeric input](https://cloud.githubusercontent.com/assets/2235499/21593670/eafea336-d119-11e6-9d4b-738141f24b44.png)
12+
```js
13+
...
14+
<ReactCodeInput type='number' digits={6} />
15+
...
16+
```
17+
18+
### Text input:
19+
![Text input](https://cloud.githubusercontent.com/assets/2235499/21593708/61cebee2-d11a-11e6-9b8d-e99dbeeec23b.png)
20+
```js
21+
...
22+
<ReactCodeInput type='text' digits={6} />
23+
...
24+
```
25+
### Password input:
26+
![Password input](https://cloud.githubusercontent.com/assets/2235499/21593710/65ed7252-d11a-11e6-995f-f0127af5bd9f.png)
27+
```js
28+
...
29+
<ReactCodeInput type='password' digits={6} />
30+
...
31+
```
32+
### Nummeric input with options:
33+
![Nummeric input with options](https://cloud.githubusercontent.com/assets/2235499/21593674/f3bb887c-d119-11e6-8b3f-ba478a0f4692.png)
34+
```js
35+
const props = {
36+
options: {
37+
width: '15px',
38+
borderRadius: '3px',
39+
fontSize: '14px',
40+
height: '26px',
41+
paddingLeft: '7px',
42+
backgroundColor: 'black',
43+
color: 'lightskyblue',
44+
border: '1px solid lightskyblue'
45+
}
46+
}
47+
...
48+
<ReactCodeInput type='number' digits={6} {...props}/>
49+
...
50+
```
51+
52+
## License
53+
MIT

example/example.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ import ReactMarkdown from 'react-markdown'
55

66
const App = React.createClass({
77
render() {
8+
const props = {
9+
options: {
10+
width: '15px',
11+
borderRadius: '3px',
12+
fontSize: '14px',
13+
height: '26px',
14+
paddingLeft: '7px',
15+
backgroundColor: 'black',
16+
color: 'lightskyblue',
17+
border: '1px solid lightskyblue'
18+
}
19+
}
20+
821
return (<div>
922
<h4>Nummeric input</h4>
1023
<ReactCodeInput type="number" digits={6} />
@@ -27,12 +40,12 @@ const App = React.createClass({
2740
```" />
2841
<h4>Nummeric input with options</h4>
2942
<div style={{ backgroundColor: 'black', display: 'inline-block' }}>
30-
<ReactCodeInput type="number" options={{ width: '15px', borderRadius: '3px', fontSize: '14px', height: '26px', paddingLeft: '7px', backgroundColor: 'black', color: 'lightskyblue', border: '1px solid lightskyblue' }} digits={6} />
43+
<ReactCodeInput type="number" digits={6} {...props} />
3144
</div>
32-
<ReactMarkdown source="**Example:**
33-
```
34-
<ReactCodeInput type='number' digits={6} options={{ width: '15px', borderRadius: '3px', fontSize: '14px', height: '26px', paddingLeft: '7px', backgroundColor: 'black', color: 'lightskyblue', border: '1px solid lightskyblue' }}/>
35-
```" />
45+
<ReactMarkdown source="**Example:**
46+
```
47+
<ReactCodeInput type='number' digits={6} {...props}/>
48+
```" />
3649
</div>);
3750
}
3851
});

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/styles.css

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/styles.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"keywords": [
1515
"react",
1616
"react-component",
17-
"react-code-input"
17+
"react-code-input",
18+
"code",
19+
"input",
20+
"chiffre"
1821
],
1922
"author": "Konstantin Kulinicenko",
2023
"license": "MIT",

styles/style.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.react-code-input {
2+
input[type="number"]::-webkit-outer-spin-button,
3+
input[type="number"]::-webkit-inner-spin-button {
4+
-webkit-appearance: none;
5+
margin: 0;
6+
}
7+
input[type="number"] {
8+
-moz-appearance: textfield;
9+
}
10+
}

test/test.js

Whitespace-only changes.

0 commit comments

Comments
 (0)