{"id":4038,"url":"https://github.com/d-a-n/react-native-modal-picker","last_synced_at":"2025-12-29T14:24:38.812Z","repository":{"id":49528728,"uuid":"52912305","full_name":"d-a-n/react-native-modal-picker","owner":"d-a-n","description":"A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.","archived":false,"fork":false,"pushed_at":"2022-10-24T18:36:48.000Z","size":1086,"stargazers_count":409,"open_issues_count":64,"forks_count":375,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-25T00:51:19.216Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/d-a-n.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":"2016-03-01T21:44:17.000Z","updated_at":"2024-03-30T23:13:54.000Z","dependencies_parsed_at":"2023-01-20T09:32:56.199Z","dependency_job_id":null,"html_url":"https://github.com/d-a-n/react-native-modal-picker","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-a-n%2Freact-native-modal-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-a-n%2Freact-native-modal-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-a-n%2Freact-native-modal-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-a-n%2Freact-native-modal-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-a-n","download_url":"https://codeload.github.com/d-a-n/react-native-modal-picker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576893,"owners_count":17939645,"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","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:16:59.211Z","updated_at":"2025-12-29T14:24:38.784Z","avatar_url":"https://github.com/d-a-n.png","language":"JavaScript","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"[![npm version](https://badge.fury.io/js/react-native-modal-picker.svg)](https://badge.fury.io/js/react-native-modal-picker)\n\n# react-native-modal-picker\nA cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.\n\n## Demo\n\n\u003cimg src=\"https://raw.githubusercontent.com/d-a-n/react-native-modal-picker/master/docs/demo.gif\" /\u003e\n\n## Install\n\n```sh\nnpm i react-native-modal-picker --save\n```\n\n## Usage\n\nYou can either use this component as an wrapper around your existing component or use it in its default mode. In default mode a customizable button is rendered.\n\nSee `SampleApp` for an example how to use this component.\n\n```jsx\n\nimport ModalPicker from 'react-native-modal-picker'\n\n[..]\n\nclass SampleApp extends Component {\n\n    constructor() {\n        super();\n\n        this.state = {\n            textInputValue: ''\n        }\n    }\n\n    render() {\n        let index = 0;\n        const data = [\n            { key: index++, section: true, label: 'Fruits' },\n            { key: index++, label: 'Red Apples' },\n            { key: index++, label: 'Cherries' },\n            { key: index++, label: 'Cranberries' },\n            { key: index++, label: 'Pink Grapefruit' },\n            { key: index++, label: 'Raspberries' },\n            { key: index++, section: true, label: 'Vegetables' },\n            { key: index++, label: 'Beets' },\n            { key: index++, label: 'Red Peppers' },\n            { key: index++, label: 'Radishes' },\n            { key: index++, label: 'Radicchio' },\n            { key: index++, label: 'Red Onions' },\n            { key: index++, label: 'Red Potatoes' },\n            { key: index++, label: 'Rhubarb' },\n            { key: index++, label: 'Tomatoes' }\n        ];\n\n        return (\n            \u003cView style={{flex:1, justifyContent:'space-around', padding:50}}\u003e\n\n                \u003cModalPicker\n                    data={data}\n                    initValue=\"Select something yummy!\"\n                    onChange={(option)=\u003e{ alert(`${option.label} (${option.key}) nom nom nom`) }} /\u003e\n\n                \u003cModalPicker\n                    data={data}\n                    initValue=\"Select something yummy!\"\n                    onChange={(option)=\u003e{ this.setState({textInputValue:option.label})}}\u003e\n                    \n                    \u003cTextInput\n                        style={{borderWidth:1, borderColor:'#ccc', padding:10, height:30}}\n                        editable={false}\n                        placeholder=\"Select something yummy!\"\n                        value={this.state.textInputValue} /\u003e\n                        \n                \u003c/ModalPicker\u003e\n            \u003c/View\u003e\n        );\n    }\n}\n```\n\n## Props\n\n* `data - []` required, array of objects with a unique key and label\n* `style - object` optional, style definitions for the root element\n* `onChange - function` optional, callback function, when the users has selected an option\n* `initValue - string` optional, text that is initially shown on the button\n* `cancelText - string` optional, text of the cancel button\n* `selectStyle - object` optional, style definitions for the select element (available in default mode only!)\n* `selectTextStyle - object` optional, style definitions for the select element (available in default mode only!)\n* `overlayStyle - object` optional, style definitions for the overly/background element\n* `sectionStyle - object` optional, style definitions for the section element\n* `sectionTextStyle - object` optional, style definitions for the select text element\n* `optionStyle - object` optional, style definitions for the option element\n* `optionTextStyle - object` optional, style definitions for the option text element\n* `cancelStyle - object` optional, style definitions for the cancel element\n* `cancelTextStyle - object` optional, style definitions for the cancel text element\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-a-n%2Freact-native-modal-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-a-n%2Freact-native-modal-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-a-n%2Freact-native-modal-picker/lists"}