{"id":13404126,"url":"https://github.com/n4kz/react-native-material-dropdown","last_synced_at":"2025-04-13T22:27:42.965Z","repository":{"id":38808504,"uuid":"92495401","full_name":"n4kz/react-native-material-dropdown","owner":"n4kz","description":"Material dropdown with consistent behaviour on iOS and Android","archived":false,"fork":false,"pushed_at":"2022-12-11T18:22:45.000Z","size":196,"stargazers_count":747,"open_issues_count":154,"forks_count":599,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-07T22:08:34.207Z","etag":null,"topics":["android","ios","material","material-design","react","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n4kz.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-26T09:33:41.000Z","updated_at":"2025-04-01T12:30:20.000Z","dependencies_parsed_at":"2023-01-27T04:30:41.556Z","dependency_job_id":null,"html_url":"https://github.com/n4kz/react-native-material-dropdown","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-material-dropdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-material-dropdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-material-dropdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n4kz%2Freact-native-material-dropdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n4kz","download_url":"https://codeload.github.com/n4kz/react-native-material-dropdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248790320,"owners_count":21161987,"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":["android","ios","material","material-design","react","react-native"],"created_at":"2024-07-30T19:01:39.436Z","updated_at":"2025-04-13T22:27:42.741Z","avatar_url":"https://github.com/n4kz.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","React Native","Stale","React, React Native"],"sub_categories":["Components React Native","React Native \u0026 Expo","Components"],"readme":"[npm-badge]: https://img.shields.io/npm/v/react-native-material-dropdown.svg?colorB=ff6d00\n[npm-url]: https://npmjs.com/package/react-native-material-dropdown\n[license-badge]: https://img.shields.io/npm/l/react-native-material-dropdown.svg?colorB=448aff\n[license-url]: https://raw.githubusercontent.com/n4kz/react-native-material-dropdown/master/license.txt\n[codeclimate-badge]: https://img.shields.io/codeclimate/maintainability/n4kz/react-native-material-dropdown.svg\n[codeclimate-url]: https://codeclimate.com/github/n4kz/react-native-material-dropdown\n[example-url]: https://user-images.githubusercontent.com/2055622/27727487-591a807a-5d87-11e7-89f6-f31a442db0c6.gif\n[textinput]: https://facebook.github.io/react-native/docs/textinput.html#props\n[touchable]: https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props\n[textfield]: https://github.com/n4kz/react-native-material-textfield#properties\n\n# react-native-material-dropdown\n\n[![npm][npm-badge]][npm-url]\n[![license][license-badge]][license-url]\n[![codeclimate][codeclimate-badge]][codeclimate-url]\n\nMaterial dropdown with consistent behaviour on iOS and Android\n\n![example][example-url]\n\n## Features\n\n* Easy to use\n* Consistent look and feel on iOS and Android\n* Customizable font size, colors and animation duration\n* Dynamic dropdown size and position\n* Configurable visible item count\n* RTL support\n* Pure javascript implementation\n\n## Installation\n\n```bash\nnpm install --save react-native-material-dropdown\n```\n\n## Usage\n\n```javascript\nimport React, { Component } from 'react';\nimport { Dropdown } from 'react-native-material-dropdown';\n\nclass Example extends Component {\n  render() {\n    let data = [{\n      value: 'Banana',\n    }, {\n      value: 'Mango',\n    }, {\n      value: 'Pear',\n    }];\n\n    return (\n      \u003cDropdown\n        label='Favorite Fruit'\n        data={data}\n      /\u003e\n    );\n  }\n}\n```\n\n## Properties\n\n name              | description                                   | type     | default\n:----------------- |:--------------------------------------------- | --------:|:------------------\n label             | Text field label text                         |   String | -\n error             | Text field error text                         |   String | -\n animationDuration | Text field animation duration in ms           |   Number | 225\n fontSize          | Text field font size                          |   Number | 16\n labelFontSize     | Text field label font size                    |   Number | 12\n baseColor         | Text field base color                         |   String | rgba(0, 0, 0, .38)\n textColor         | Text field text color                         |   String | rgba(0, 0, 0, .87)\n itemColor         | Dropdown item text color (inactive item)      |   String | rgba(0, 0, 0, .54)\n selectedItemColor | Dropdown item text color (active item)        |   String | rgba(0, 0, 0, .87)\n disabledItemColor | Dropdown item text color (disabled item)      |   String | rgba(0, 0, 0, .38)\n dropdownPosition  | Dropdown position (dynamic if undefined)      |   Number | -\n itemCount         | Dropdown visible item count                   |   Number | 4\n itemPadding       | Dropdown item vertical padding                |   Number | 8\n itemTextStyle     | Dropdown item text styles                     |   Object | -\n dropdownOffset    | Dropdown offset                               |   Object | { top: 32, left: 0 }\n dropdownMargins   | Dropdown margins                              |   Object | { min: 8, max: 16 }\n data              | Dropdown item data                            |    Array | []\n value             | Selected value                                |   String | -\n containerStyle    | Styles for container view                     |   Object | -\n overlayStyle      | Styles for overlay view                       |   Object | -\n pickerStyle       | Styles for item picker view                   |   Object | -\n shadeOpacity      | Shade opacity for dropdown items              |   Number | 0.12\n rippleOpacity     | Opacity for ripple effect                     |   Number | 0.54\n rippleInsets      | Insets for ripple on base component           |   Object | { top: 16, bottom: -8 }\n rippleCentered    | Ripple on base component should be centered   |  Boolean | false\n renderBase        | Render base component                         | Function | -\n renderAccessory   | Render text field accessory                   | Function | -\n valueExtractor    | Extract value from item (args: item, index)   | Function | ({ value }) =\u003e value\n labelExtractor    | Extract label from item (args: item, index)   | Function | ({ label }) =\u003e label\n propsExtractor    | Extract props from item (args: item, index)   | Function | () =\u003e null\n onChangeText      | Selection callback (args: value, index, data) | Function | -\n\nOther [TextField][textfield], [TextInput][textinput] and [TouchableWithoutFeedback][touchable] properties will also work\n\n## Methods\n\n name            | description                    | returns\n:--------------- |:------------------------------ |:--------\n focus()         | Acquire focus (open dropdown)  | -\n blur()          | Release focus (close dropdown) | -\n value()         | Get current value              | String\n selectedIndex() | Get selected index             | Number\n selectedItem()  | Get selected item              | Object\n isFocused()     | Get current focus state        | Boolean\n\n## Example\n\n```bash\ngit clone https://github.com/n4kz/react-native-material-dropdown\ncd react-native-material-dropdown/example\nnpm install\nnpm run ios # or npm run android\n```\n\n## Copyright and License\n\nBSD License\n\nCopyright 2017-2018 Alexander Nazarov. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn4kz%2Freact-native-material-dropdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn4kz%2Freact-native-material-dropdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn4kz%2Freact-native-material-dropdown/lists"}