{"id":16454216,"url":"https://github.com/zahidalidev/react-native-cross-picker","last_synced_at":"2025-08-24T08:24:50.415Z","repository":{"id":57336325,"uuid":"354030467","full_name":"zahidalidev/react-native-cross-picker","owner":"zahidalidev","description":"A Picker component for React Native which emulates the native \u003cselect\u003e interfaces for iOS and Android","archived":false,"fork":false,"pushed_at":"2021-10-22T10:45:01.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T01:52:01.814Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/zahidalidev.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":"2021-04-02T13:39:56.000Z","updated_at":"2021-10-31T13:41:37.000Z","dependencies_parsed_at":"2022-09-11T10:03:04.348Z","dependency_job_id":null,"html_url":"https://github.com/zahidalidev/react-native-cross-picker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zahidalidev/react-native-cross-picker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidalidev%2Freact-native-cross-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidalidev%2Freact-native-cross-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidalidev%2Freact-native-cross-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidalidev%2Freact-native-cross-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zahidalidev","download_url":"https://codeload.github.com/zahidalidev/react-native-cross-picker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zahidalidev%2Freact-native-cross-picker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268448204,"owners_count":24251999,"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-02T02:00:12.353Z","response_time":74,"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-10-11T10:18:25.111Z","updated_at":"2025-08-02T20:08:26.756Z","avatar_url":"https://github.com/zahidalidev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-cross-picker\n\n[![npm version](https://badge.fury.io/js/react-native-cross-picker.svg)]()\n\u003c!-- [![npm downloads](https://img.shields.io/npm/dm/react-native-cross-picker.svg?style=flat-square)](https://www.npmjs.com/package/react-native-cross-picker) --\u003e\n\nA Picker component for React Native which emulates the native `\u003cselect\u003e` interfaces for iOS and Android\n\nFor iOS, Android or other platform this component looks same.\n\n## [View examples on snack.expo.io](https://snack.expo.io/@zahidalidev/react-native-cross-picker)\n\n## Getting Started\n\n### Installing\n\n```\nnpm install react-native-cross-picker\n\n```\n\n### Basic Usage\n\n```js\nimport React, { useState } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { MaterialCommunityIcons } from \"@expo/vector-icons\"; // for expo and any other for react-native-cli\n\nimport ReactNativeCrossPicker from \"react-native-cross-picker\"\n\n\nexport default function Picker() {\n  const [selectedItem, setItem] = useState('')\n\n const items = [\n    { label: \"label1\", value: 1 },\n    { label: \"label2\", value: 2 },\n    { label: \"label3\", value: 3 },\n    { label: \"label4\", value: 4 },\n    { label: \"label5\", value: 5 },\n    { label: \"label6\", value: 6 },\n    { label: \"label7\", value: 7 },\n    { label: \"label8\", value: 8 },\n    { label: \"label9\", value: 9 },\n  ]\n\n  const iconComponent = () =\u003e {\n    return \u003cMaterialCommunityIcons\n      name={\"chevron-down\"}\n      size={20}\n      color={\"grey\"}\n    /\u003e\n  }\n\n  return (\n    \u003cView style={styles.container}\u003e\n      \u003cReactNativeCrossPicker\n          modalTextStyle={{ color: \"rgb(0, 74, 173)\" }}\n          mainComponentStyle={{ borderColor: \"rgb(0, 74, 173)\" }}\n          iconComponent={iconComponent}\n          items={items}\n          setItem={setItem} selectedItem={selectedItem}\n          placeholder=\"Select Item\" \n          modalMarginTop={\"50%\"} // popup model margin from the top \n      /\u003e\n    \u003c/View\u003e\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    backgroundColor: '#f2efef',\n    alignItems: 'center',\n    justifyContent: 'center',\n  },\n});\n```\n\n\n### Props\n\n| Name                                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Details                  |\n| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |\n| `setItem`                                 | Will set the selected value to selectedItem                                                                                                                                                                                                                                                                                                                                                                                                                                                            | **required**\u003cbr\u003euseState hook |\n| `items`                                         | The items for the component to render\u003cbr\u003e - Each item should be in the following format:\u003cbr\u003e`{label: 'Orange', value: 'orange'}`\u003cbr\u003e- `label` and `value` are required\u003cbr\u003e- `value` can be any data type\u003cbr\u003e-                                    | **required**\u003cbr\u003earray    |\n| `placeholder`                                   | - An override for the default placeholder, a label of `Select item`                                                                                                  | string           |\n| `placeholderStyle`                                   | - An override for the default placeholder style                                                                                                  | style           |\n| `modalTextStyle`                                         | Style overrides for text parts of the popup component.\u003cbr\u003e                                                                                                                                                                                                                                                                             | style                                                                               |\n| `modalComponentStyle`                                         | Style overrides the style of the popup component.\u003cbr\u003e                                                                                                                                                                                                                                                                             | style                                                                               |\n| `mainComponentStyle`                                         | Style overrides style of the main component.\u003cbr\u003e                                                                                                                                           | style                   |\n| `modalBottomBorderColor`                                   | Additional props to pass to the Picker to display the bottom border of main component                                                                                                                                                                                                                                                          | color                   |\n| `iconComponent`                                          | Custom icon component to be rendered.\u003cbr\u003e                                                                                                                                                                                                                                                                                                                                                                                                       | function that return component                                   |\n| `width`                                | Additional props to pass to the main component to set the width default will be 100%.                                                                                                                                                                                                                                                                                                                             | number, percentage like width=\"80%\".                   |\n| `placeholder`                         | Default placeholder when item is not selected                                                                                                                                                                                                                                                                                                                                                                 | string                   |\n| `modalMarginTop`\u003cbr\u003e                                    | margin of the popup model from the top default will be 50%                                                                                                                                                                                                                                                                                                                                                                                 | number, percentage etc.                 |\n| `modalMaxHeight`\u003cbr\u003e                                    | Maximum hight of the popup modal                                                                                                                                                                                                                                                                                                                                                                                                 | number, percentage etc.\n\n## License\n\nreact-native-cross-picker is [MIT licensed](https://github.com/zahidalidev/react-native-cross-picker/blob/master/LICENSE) and built with :heart: by Zahid Ali.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzahidalidev%2Freact-native-cross-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzahidalidev%2Freact-native-cross-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzahidalidev%2Freact-native-cross-picker/lists"}