{"id":4343,"url":"https://github.com/talut/react-native-countries","last_synced_at":"2025-08-04T01:31:58.225Z","repository":{"id":57336274,"uuid":"162974163","full_name":"talut/react-native-countries","owner":"talut","description":"Country  Name \u0026 Code List for React Native (Android \u0026 IOS)","archived":true,"fork":false,"pushed_at":"2020-01-20T08:09:50.000Z","size":392,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-07T08:33:26.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://taluttasgiran.com/react-native-countries","language":"Objective-C","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/talut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-24T09:30:48.000Z","updated_at":"2023-12-09T11:05:32.000Z","dependencies_parsed_at":"2022-09-11T12:21:13.161Z","dependency_job_id":null,"html_url":"https://github.com/talut/react-native-countries","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/talut/react-native-countries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talut%2Freact-native-countries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talut%2Freact-native-countries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talut%2Freact-native-countries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talut%2Freact-native-countries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talut","download_url":"https://codeload.github.com/talut/react-native-countries/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talut%2Freact-native-countries/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268636316,"owners_count":24282075,"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:08.934Z","updated_at":"2025-08-04T01:31:57.856Z","avatar_url":"https://github.com/talut.png","language":"Objective-C","readme":"# React Native Countries\n\n**React Native Countries v1.0.2** will provide you directly native countries list. The names of the countries come in the native language.\n\n## Getting Started\n\n##### Installation\n\n----------\n\n**With NPM**\n\n```bash\nnpm install --save react-native-countries\n```\n\n**With YARN**\n\n```bash\nyarn add react-native-countries\n```\n\n##### Linking\n\n-----\n\n**Automatic linking**\n\n```sh\nreact-native link react-native-countries\n```\n\n**Manual Linking**\n\n**[Manual Installation for IOS and Android](/docs/manual-installation.md)** (If something went wrong with react-native link)\n\n**With Cocoapods (IOS)**\n\nİf you're using **Cocoapods** you should add this line to your **Podfile** file\n\n```python\n  pod 'ReactNativeCountries', :path =\u003e '../node_modules/react-native-countries/ios'\n```\n\n### Usage\n\n```javascript\nimport RNCountry from \"react-native-countries\";\n```\n\nThis package will provide you **3** different options to getting countries. \n\n##### getCountryNames\n\n```javascript\nRNCountry.getCountryNames\n```\n\nThis constant will provide you only name of countries.\n\n##### getCountryCodes\n\n```javascript\nRNCountry.getCountryCodes\n```\n\nThis constant will provide you only A2 code of countries. (I.E: `EN, TR, FR`)\n\n##### getCountryNamesWithCodes\n\n```javascript\nRNCountry.getCountryNamesWithCodes\n```\n\nThis constant will provide you name and code of countries. (I.E: `[{code:'TR',name:'Turkey'},{code:'EN', name:'England'}]` )\n\n### Sample Usage\n\n```javascript\nimport React, {Component} from 'react';\nimport {Picker, StyleSheet, Text, View} from 'react-native';\nimport RNCountry from \"react-native-countries\";\n\nexport default class App extends Component {\n    constructor(props) {\n        super(props);\n        this.state = {\n            countryCode: \"TR\"\n        }\n    }\n\n    componentWillMount() {\n        let countryNamesWithCodes = RNCountry.getCountryNamesWithCodes;\n        countryNamesWithCodes.sort((a, b) =\u003e a.name.localeCompare(b.name));\n        this.setState({\n            countryNameListWithCode: countryNamesWithCodes\n        })\n    }\n\n    render() {\n        return (\n            \u003cView style={styles.container}\u003e\n                \u003cPicker\n                    selectedValue={this.state.countryCode}\n                    style={styles.picker}\n                    onValueChange={(itemValue, itemIndex) =\u003e this.setState({countryCode: itemValue})}\u003e\n                    {this.state.countryNameListWithCode.map((val) =\u003e {\n                        return \u003cPicker.Item key={'country-item-' + val.code} label={val.name} value={val.code}/\u003e\n                    })}\n                \u003c/Picker\u003e\n                \u003cText\u003eSelected Country Code: {this.state.countryCode}\u003c/Text\u003e\n            \u003c/View\u003e\n        )\n    }\n}\nconst styles = StyleSheet.create({\n    container: {\n        flex: 1,\n        justifyContent: 'center',\n        alignItems: 'center'\n    },\n    picker: {\n        height: 50,\n        width: 200\n    }\n});\n```\n\n\n### Example\n\nYou can find the usage example of the package in the example folder. \n\n```console\ngit clone https://github.com/talut/react-native-countries\n\ncd react-native-countries/example\n\nnpm install\n\nreact-native run-ios or android\n```\n\n### Thanks\n\n- Thanks to you [@cagriyilmaz](https://github.com/cagriyilmaz) for IOS part.\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","funding_links":[],"categories":["Components"],"sub_categories":["UI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalut%2Freact-native-countries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalut%2Freact-native-countries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalut%2Freact-native-countries/lists"}