├── .gitignore
├── LICENSE
├── README.md
├── images
└── demo.gif
├── index.js
├── lib
├── .DS_Store
├── indicator.js
├── option.js
├── optionlist.js
└── select.js
└── package.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # nyc test coverage
18 | .nyc_output
19 |
20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21 | .grunt
22 |
23 | # node-waf configuration
24 | .lock-wscript
25 |
26 | # Compiled binary addons (http://nodejs.org/api/addons.html)
27 | build/Release
28 |
29 | # Dependency directories
30 | node_modules
31 | jspm_packages
32 |
33 | # Optional npm cache directory
34 | .npm
35 |
36 | # Optional REPL history
37 | .node_repl_history
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Azharuddin
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Native Chooser
2 | Simple DropDown menu for React Native App! Your Select Tag for React Native. Fully Customizable too.
3 |
4 | ## Introduction
5 |
6 | React Native Chooser is simple, customizable and easy to use dropdown in React Native. It has been tested on both Android and IOS and works like a charm.
7 |
8 |
9 | ## Installation
10 | ```
11 | npm i react-native-chooser --save
12 | ```
13 |
14 | ## Usage
15 |
16 | ```js
17 | import React, { Component } from 'react';
18 | import {Select, Option} from "react-native-chooser";
19 |
20 | import {
21 | AppRegistry,
22 | StyleSheet,
23 | Text,
24 | View
25 | } from 'react-native';
26 |
27 | export default class AwesomeProject extends Component {
28 |
29 | constructor(props) {
30 | super(props);
31 | this.state = {value : "Select Me Please"}
32 | }
33 | onSelect(value, label) {
34 | this.setState({value : value});
35 | }
36 |
37 | render() {
38 | return (
39 |
40 |
59 |
60 | );
61 | }
62 | }
63 | ```
64 |
65 | ### Props
66 |
67 | #### Props for Select
68 |
69 | | Prop Name | Data Type | Default Values | Description |
70 | |-----------------|-----------|-----------------|--------------------------------------------------|
71 | | onSelect | function | null | function that executes on selection of an option |
72 | | defaultText | string | Click To Select | Text to show as default text |
73 | | style | object | null | To style the select box. |
74 | | backdropStyle | object | null | To style the overlay |
75 | | textStyle | object | null | To style the text shown in the box |
76 | | optionListStyle | object | null | To style the selection box |
77 | | transparent | boolean | false | To set the transparent prop on Modal |
78 | | animationType | string | "none" | To set the animationType prop on Modal |
79 | | indicator | string | "none", "up" or "down" | "none" | To enable an indicator arrow |
80 | | indicatorColor | string | "black" | The color of the indicator arrow |
81 | | indicatorSize | number | 10 | The size of the indicator arrow |
82 | | indicatorStyle | object | null | To style the indicator arrow |
83 | | indicatorIcon | react element | null | Show the indicator icon |
84 | | selected | string | null | Give it same value as you give to Option |
85 | | selectedStyle | object | null | Apply styles to the selected Option |
86 |
87 | #### Functions for Select
88 |
89 | | Function Name | Description |
90 | |-----------|-----------|
91 | | setSelectedText(text) | Set default text in the select option, often used to reset text.|
92 |
93 | #### Props for Option
94 |
95 | | Prop Name | Data Type | Default Values | Description |
96 | |-----------|-----------|----------------|---------------------------------------|
97 | | style | object | null | To style each option |
98 | | styleText | object | null | To style the text shown in the option |
99 |
100 | ## Demo
101 | ### IOS and Android:
102 |