1.1.2 • Published 5 years ago

react-native-country-code-list v1.1.2

Weekly downloads
48
License
MIT
Repository
github
Last release
5 years ago

ReactNativeCountryCodeList

Country code list with alphabet navigation npm version npm version

Country code list with alphabet navigation for Android/IOS to use with react-native, based on react-native-alphabetlistview, also using react-native-search-box

Installation

  1. npm install react-native-country-code-list --save or yarn add react-native-country-code-list

Demo

npm.io

Usage

import CountryCodeList from 'react-native-country-code-list'

class CountryCodeListApp extends React.Component {
    render() {
      return (
        <CountryCodeList
	  onClickCell={(cellObject) => console.log(cellObject)}
	  />
      );
    }

Props

All props are optional

Note if you will pass custom data as a list you also must provide renderCell, renderSectionHeader, renderSectionItem functions and search action.

PropDefaultTypeDescription
datacountry code list objectobjectCustom list data
alphabetListPropsundefinedobjectreact-native-alphabetlistview props
searchPropsundefinedobjectreact-native-search-box props
onClickCell() => {}funcCallback onClick list item
headerBackgroundrgb(245, 245, 245)anybackground for headers and search wrapper
cellHeight44.5numberCell height
sectionHeaderHeight30numberSection header height
renderCellfuncfuncCustom Cell component
renderSectionItemfuncfuncCustom Section Item (Alphabet) component
renderSectionHeaderfuncfuncCustom Section header component
sectionHeaderStylestyleanystyle section header
sectionHeaderTextStylestyleanystyle section header text
sectionItemTextStylestyleanystyle section item text
cellStylestyleanystyle list item
cellTitleStylestyleanystyle list item title
cellLabelStylestyleanystyle list item right label

Questions or suggestions?

Feel free to open an issue