Skip to content

Commit

Permalink
published
Browse files Browse the repository at this point in the history
  • Loading branch information
plxity committed Jul 15, 2019
0 parents commit fec9e6f
Show file tree
Hide file tree
Showing 13 changed files with 6,840 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"transform-object-rest-spread",
"transform-react-jsx"
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
demo
.babelrc
webpack.config.js
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#043338",
"titleBar.activeBackground": "#06474E",
"titleBar.activeForeground": "#F1FDFE"
}
}
Binary file added Capture.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Capture1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# React Pincode

[<img src="./Capture.PNG" style="width: 100%;" />](https://github.com/plxity/React-Pincode)

[<img src="./Capture1.PNG" style="width: 100%;" />](https://github.com/plxity/React-Pincode)
## Installation

```
npm install --save react-pincode
```

## Usage

### Note
This will only work for Indian Pincodes.


The three input fields are wrapped inside an <div> Element.
and each input field is also wrapped inside <div>. So that a user can style it according to the need in the project.

Whenever the wrong Pincode is entered red border appears on the pin code input field and on entering a right pin code, city and state input fields get automatically filled with correct data



## Working

```js
import Pincode from "react-pincode";
```

### JS

```js
import React, { Component } from 'react';
import Pincode from "react-pincode";

export default class Example extends Component {
render() {
return (
<div>
<Pincode />
</div>
)
}
}

export default Example;
```

## Pincode Props

| Name | Description |
| ---------------- | ----------------------------------------------- |
| Container | Container which wraps all the three Input Field |
| pincodeContainer | Container which wraps pincode Input Field |
| cityContainer | Container which wraps City Input Field |
| stateContainer | Container which wraps StateInput Field |
| pincodeInput | Props for styling pincode input field |
| cityInput | Props for styling city input field |
| stateInput | Props for styling state input field |

## Example

### JS

```js
import React, { Component } from 'react';
import Pincode from "react-pincode";

export default class Example extends Component {
render() {
return (
<div>
<Pincode cityInput={{width:'200px'}}/>
// This will set the length of city input field to 200px. You can play with rest of the props to style it according to your need.
</div>
)
}
}

export default Example;
```


8 changes: 8 additions & 0 deletions build/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit fec9e6f

Please sign in to comment.