Country Code Picker

Country Code Picker (CCP) is a component which provides an easy way to search and select country phone code ( national code ) for the telephone number.

Usage

Basic Usage

import {CountryCodePicker} from 'arivaa-basic';
//In default modal mode
<CountryCodePicker/>
//In Picker Mode
<CountryCodePicker type="picker"/>

 

Advanced Usage

import {CountryCodePicker} from 'arivaa-basic';
//With Label Formatter, Value Formatter and onChange callback
<CountryCodePicker
    type="picker"
    labelFormatter = {(obj)=>{
        return "You love "+obj.name+"?"
    }}
    valueFormatter = {(obj)=>{
        return "You loved "+obj.name+"?"
    }}
    onChange={(value)=>{this.setState({value})}}
/>

 

Note: This component is completely compatible with Form Component and can be used with the forms architecture.

Supported properties {#supported-properties}

Properties Description Type Default
type Type of select to be used (modal or picker) String modal
title Select title String Select Country
valueFormatter Function to format value (Should return the formatted value) function(value){} -
labelFormatter Function to format label (Should return the formatted label) function(label){} -

Note: Along with above properties, All the properties of select component are applicable to this component.

Published On June 6, 2020 6:18 PM

Last Updated October 9, 2020 6:49 AM