Installations
npm install rn-modal-picker
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
22.1.0
NPM Version
10.7.0
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (95.64%)
JavaScript (4.36%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
57,274
Last Day
18
Last Week
85
Last Month
442
Last Year
6,258
GitHub Statistics
45 Stars
155 Commits
19 Forks
3 Watching
4 Branches
3 Contributors
Package Meta Information
Latest Version
0.4.9
Package Id
rn-modal-picker@0.4.9
Unpacked Size
833.82 kB
Size
610.78 kB
File Count
29
NPM Version
10.7.0
Node Version
22.1.0
Publised On
29 Jul 2024
Total Downloads
Cumulative downloads
Total Downloads
57,274
Last day
-18.2%
18
Compared to previous day
Last week
-26.1%
85
Compared to previous week
Last month
36.4%
442
Compared to previous month
Last year
-4.3%
6,258
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
2
React Native Modal Picker
This is a cross-platform picker with search bar for react native which supports iOS, Android and Web
Android | iOS | Web |
---|---|---|
Features
- Easy to use.
- Cross-platform compatibility Android, iOS and Web.
- Hide and show search bar.
- Dynamically change dropdown and search image.
- Customize font size, font color and picker style.
- Change animation(Slide, fade, none)
Installation
Step 1 Install
npm i rn-modal-picker
Usage
1import React, { useState } from "react"; 2import { Platform, StyleSheet, Text, View } from "react-native"; 3import ModalPicker from "rn-modal-picker"; 4 5const dataSource = [ 6 { 7 id: 1, 8 name: "Afghanistan", 9 }, 10 { 11 id: 2, 12 name: "Bahrain", 13 }, 14 { 15 id: 3, 16 name: "Canada", 17 }, 18 { 19 id: 4, 20 name: "Denmark", 21 }, 22 { 23 id: 5, 24 name: "Egypt", 25 }, 26 { 27 id: 6, 28 name: "France", 29 }, 30 { 31 id: 7, 32 name: "Greece", 33 }, 34 { 35 id: 8, 36 name: "Hong Kong", 37 }, 38 { 39 id: 9, 40 name: "India", 41 }, 42 { 43 id: 10, 44 name: "Japan", 45 } 46]; 47const App = () => { 48 const [value, setValue] = useState(""); 49 50 return ( 51 <View style={styles.container}> 52 <Text style={styles.titleText}>React Native Modal Picker</Text> 53 54 <ModalPicker 55 value={value} 56 data={dataSource} 57 animationType={"slide"} 58 pickerContainerStyle={styles.pickerStyle} 59 dropDownIcon={require("./res/ic_drop_down.png")} 60 selectedTextStyle={styles.selectedTextStyle} 61 listTextStyle={styles.listTextStyle} 62 placeHolderText={"Please select country"} 63 searchBarPlaceHolder={"Search......"} 64 searchBarPlaceHolderColor={"grey"} 65 placeHolderTextColor={"black"} 66 searchBarStyle={styles.searchBarStyle} 67 searchClearIcon={require("./res/ic_close.png")} 68 onChange={(value) => { 69 setValue(value); 70 }} 71 /> 72 </View> 73 ); 74}; 75export default App; 76 77const styles = StyleSheet.create({ 78 container: { 79 flex: 1, 80 justifyContent: "center", 81 alignItems: "center", 82 backgroundColor: "#F5FCFF", 83 }, 84 titleText: { 85 color: "#000", 86 fontSize: 25, 87 marginBottom: 25, 88 fontWeight: "bold", 89 }, 90 pickerStyle: { 91 height: 50, 92 width: "100%", 93 marginVertical: 10, 94 borderColor: "#303030", 95 alignItems: "center", 96 alignSelf: "center", 97 padding: 10, 98 backgroundColor: "white", 99 borderRadius: 5, 100 borderWidth: 1.5, 101 fontSize: 16, 102 color: "#000", 103 }, 104 selectedTextStyle: { 105 paddingLeft: 5, 106 color: "#000", 107 textAlign: "right", 108 }, 109 listTextStyle: { 110 color: "#000", 111 textAlign: "right", 112 }, 113 114 searchBarStyle: { 115 margin: 10, 116 padding: 10, 117 flexDirection: "row", 118 height: 45, 119 shadowOpacity: 1.0, 120 shadowRadius: 2, 121 shadowOffset: { 122 width: 1, 123 height: 1, 124 }, 125 backgroundColor: "rgba(255,255,255,1)", 126 shadowColor: Platform.OS === "ios" ? "rgba(0,0,0,0.3)" : "rgba(0,0,0,1)", 127 borderRadius: 10, 128 elevation: 5, 129 }, 130}); 131
Properties
Prop | Default | Type | Description | Required/Optional |
---|---|---|---|---|
data | [] | array | Array of objects with a unique id and name | Required |
hideSearchBar | false | bool | Show and hide search bar | Optional |
value | - | string | Set selected value otherwise its blank $ use for default value | Optional |
placeHolderText | - | string | Use to Show place holder hint text | Required |
pickerContainerStyle | - | object | Customize picker style | Required |
listTextStyle | - | object | Customize list item text style | Optional |
placeHolderTextColor | - | object | Customize placeholder text color | Optional |
itemSeparatorStyle | - | object | Style for Horizontal Line between item | Optional |
selectedTextStyle | - | object | Customize selected text style | Optional |
searchBarStyle | - | object | Customize Search bar Container style | Optional |
onChange | - | function | callback function received value from list selection | Required |
animationType | - | string [slide,none,fade] | Change Modal Animation | Optional |
disable | - | bool | Disable picker if you show default value and no need to change | Optional |
searchBarPlaceHolder | - | string | Search bar place holder text | Optional |
searchBarPlaceHolderColor | - | color code | Add color code | Optional |
dropDownIconStyle | - | object | Change drop down icon style color | Optional |
searchClearIcon | - | png/jpg | Change search bar text clear icon style | Optional |
searchIcon | - | png/jpg | Change search bar icon style color | Optional |
dropDownIcon | - | png/jpg | Change picker drop down icon | Optional |
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 24 are checked with a SAST tool
Score
2
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More