Gathering detailed insights and metrics for @davzon/react-country-state-city
Gathering detailed insights and metrics for @davzon/react-country-state-city
npm install @davzon/react-country-state-city
Typescript
Module System
Node Version
NPM Version
66
Supply Chain
98.2
Quality
75.6
Maintenance
100
Vulnerability
100
License
TypeScript (81.5%)
SCSS (8.5%)
JavaScript (6.63%)
HTML (2.82%)
CSS (0.55%)
Total Downloads
4,462
Last Day
6
Last Week
27
Last Month
103
Last Year
3,292
2 Stars
25 Commits
1 Branches
Minified
Minified + Gzipped
Latest Version
1.0.10
Package Id
@davzon/react-country-state-city@1.0.10
Unpacked Size
73.30 kB
Size
11.66 kB
File Count
10
NPM Version
9.3.1
Node Version
18.14.0
Publised On
01 Aug 2023
Cumulative downloads
Total Downloads
Last day
500%
6
Compared to previous day
Last week
-6.9%
27
Compared to previous week
Last month
-39.1%
103
Compared to previous month
Last year
181.4%
3,292
Compared to previous year
1
34
React-country-state-city allows you to create a responsive country, state, city dropdown with search options.
$ npm install --save react-country-state-city
$ yarn add react-country-state-city
1import { 2 CitySelect, 3 CountrySelect, 4 StateSelect, 5} from "react-country-state-city"; 6import "react-country-state-city/dist/react-country-state-city.css"; 7 8function App() { 9 const [countryid, setCountryid] = useState(0); 10 const [stateid, setstateid] = useState(0); 11 return ( 12 <div> 13 <h6>Country</h6> 14 <CountrySelect 15 onChange={(e) => { 16 setCountryid(e.id); 17 }} 18 placeHolder="Select Country" 19 /> 20 <h6>State</h6> 21 <StateSelect 22 countryid={countryid} 23 onChange={(e) => { 24 setstateid(e.id); 25 }} 26 placeHolder="Select State" 27 /> 28 <h6>City</h6> 29 <CitySelect 30 countryid={countryid} 31 stateid={stateid} 32 onChange={(e) => { 33 console.log(e); 34 }} 35 placeHolder="Select City" 36 /> 37 </div> 38 ); 39}
Properties used to customise the rendering:
Name | Type | Description |
---|---|---|
defaultValue | Country | optional The current value: a country object |
containerClassName | string | optional styles for a container |
inputClassName | string | optional styles for input box |
onChange | function | optional The current value: a country object.The argument is the country object |
onTextChange | function | optional A callback fired when the input text changes. |
placeHolder | string | optional Placeholder text displayed in empty input |
showFlag | boolean | optional Flags are displayed when true and not displayed when false. default is true. |
The same country select properties and additionally
Name | Type | Description |
---|---|---|
countryid | number | required The id of the selected country object |
The same country select properties and additionally
Name | Type | Description |
---|---|---|
countryid | number | required The id of the selected country object |
stateid | number | required The id of the selected state object |
A demo is worth a thousand words
Show your ❤️ and support by giving a ⭐. Any suggestions are welcome! venkatmcajj@gmail.com
Become a financial contributor and help us sustain our community. Contribute
Licensed under MIT
No vulnerabilities found.
No security vulnerabilities found.