{"id":4175,"url":"https://github.com/chymtt/ReactNativeDropdownAndroid","last_synced_at":"2025-08-04T00:32:25.790Z","repository":{"id":57336642,"uuid":"43483122","full_name":"chymtt/ReactNativeDropdownAndroid","owner":"chymtt","description":"A simple wrapper for Android's Spinner in react-native","archived":false,"fork":false,"pushed_at":"2016-10-26T07:45:44.000Z","size":49,"stargazers_count":61,"open_issues_count":6,"forks_count":22,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-07T07:34:38.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chymtt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-01T07:09:35.000Z","updated_at":"2024-11-02T04:44:00.000Z","dependencies_parsed_at":"2022-09-11T08:52:12.680Z","dependency_job_id":null,"html_url":"https://github.com/chymtt/ReactNativeDropdownAndroid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chymtt/ReactNativeDropdownAndroid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chymtt%2FReactNativeDropdownAndroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chymtt%2FReactNativeDropdownAndroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chymtt%2FReactNativeDropdownAndroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chymtt%2FReactNativeDropdownAndroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chymtt","download_url":"https://codeload.github.com/chymtt/ReactNativeDropdownAndroid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chymtt%2FReactNativeDropdownAndroid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268634064,"owners_count":24281896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:03.469Z","updated_at":"2025-08-04T00:32:25.501Z","avatar_url":"https://github.com/chymtt.png","language":"Java","readme":"# react-native-dropdown-android\n\nA simple wrapper for Android's Spinner\n\n## Installation Android\n1. `npm install --save react-native-dropdown-android`\n2. In `android/settings.gradle`\n\n    ```gradle\n    ...\n    include ':ReactNativeDropdownAndroid', ':app'\n    project(':ReactNativeDropdownAndroid').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dropdown-android/android')\n    ```\n\n3. In `android/app/build.gradle`\n\n    ```gradle\n    ...\n    dependencies {\n        ...\n        compile project(':ReactNativeDropdownAndroid')\n    }\n    ```\n\n4. Register module (in MainActivity.java)\n\n    4.1. With RN \u003c 0.19.0\n\n        ```java\n        import com.chymtt.reactnativedropdown.DropdownPackage; // \u003c----- import\n\n        public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {\n          ......\n\n          @Override\n          protected void onCreate(Bundle savedInstanceState) {\n            super.onCreate(savedInstanceState);\n            mReactRootView = new ReactRootView(this);\n\n            mReactInstanceManager = ReactInstanceManager.builder()\n              .setApplication(getApplication())\n              .setBundleAssetName(\"index.android.bundle\")\n              .setJSMainModuleName(\"index.android\")\n              .addPackage(new MainReactPackage())\n              .addPackage(new DropdownPackage())              // \u003c------ add here\n              .setUseDeveloperSupport(BuildConfig.DEBUG)\n              .setInitialLifecycleState(LifecycleState.RESUMED)\n              .build();\n\n            mReactRootView.startReactApplication(mReactInstanceManager, \"ExampleRN\", null);\n\n            setContentView(mReactRootView);\n          }\n          ......\n        }\n        ```\n\n    4.2. With RN \u003e= 0.19.0\n\n        ```java\n        import com.chymtt.reactnativedropdown.DropdownPackage; // \u003c----- import\n\n        public class MainActivity extends ReactActivity {\n            ...\n\n            @Override\n            protected List\u003cReactPackage\u003e getPackages() {\n              return Arrays.\u003cReactPackage\u003easList(\n                new MainReactPackage(),\n                new DropdownPackage() // \u003c------ add here\n              );\n            }\n        }\n        ```\n\n## Usage\n\n```js\n\nvar Dropdown = require('react-native-dropdown-android');\n...\n\n  render() {\n    return (\n      \u003cDropdown\n        style={{ height: 20, width: 200}}\n        values={[ '--Choose--', 'one', 2, 3.5, { four: 4 }, [ 5, 6, 7 ], false ]}\n        selected={1} onChange={(data) =\u003e { console.log(data); }} /\u003e\n    );\n  }\n```\n\n## Props\n\n### style\n\nRight now you should always and only provide its height and width, otherwise the dropdown won't show up at all\n\n### values\n\nAn array of options. This should be provided with an __array of strings__. Any type other than string will be converted to its string representation\n\n### selected\n\nAn int indicating which option (zero-based) is currently selected\n\n### onChange(data)\n\nCallback with data in the form `data = { selected: 1, value: 'one' }`\n\n## Questions or suggestions?\n\nFeel free to [open an issue](https://github.com/chymtt/ReactNativeDropdownAndroid/issues)\n[Pull requests](https://github.com/chymtt/ReactNativeDropdownAndroid/pulls) are also welcome\n","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchymtt%2FReactNativeDropdownAndroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchymtt%2FReactNativeDropdownAndroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchymtt%2FReactNativeDropdownAndroid/lists"}