React Pincode is a web application which extracts the information and displays it to the user on the basis of pincode which is added by the user.
See this app live at https://react-pincode.netlify.com/
Snippet of the working application is displayed below.
- About
- Prerequisites
- Steps to set the environment
- Usage/Need
- Working
- Pincode props
- Example
- Contributing
- Development Guidelines
- Owner
- Mentor
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
- NodeJS (check for it's installation on terminal using npm -v)
- Clone the repository
git clone https://github.com/Awesome-React-Modules/React-Pincode.git
- Install Dependencies
npm install --save react-pincode
To get instant information when the user enters just the pincode.
This will only work for Indian Pincodes.
import Pincode from "react-pincode";
import React, { Component } from 'react';
import Pincode from "react-pincode";
export default class Example extends Component {
render() {
return (
<div>
<Pincode />
</div>
)
}
}
export default Example;
Find Codepen Implementation of the module here
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 |
districtContainer | Container which wraps District 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 |
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;
- Set-up the React-Pincode module by dowloading its dependencies, using
npm install
command. - Build the module using
npm run build
- Link the module for testing using
npm link
command. - Change your directory to
test-server
directory, usingcd test-server
- Install the dependecies using
npm install
- Now run
npm link react-pincode
- Congratulations! You have set-up the test server for react-pincode.
Now just run
npm start
fromtest-server
directory to launch the test-server. - You don't need to stop this server, the changes made in the module will be reflected automatically each time you build them using
npm run build
- To watch a video on installation :
Please read Contributing Guidelines for information on how to contribute to React-Pincode.
- Write clean and readable code with proper formatting.
- Create a branch and push your code in the branch.
- Please follow PR template to create PR.
- Please read our Code of Conduct .
Feel Free to ask your queries!!
Happy Coding 🚀 🚀