Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@digieggs/rn-country-code-picker
Advanced tools
Readme
You can read our article about this package: https://medium.com/digieggs/complete-guide-to-using-country-code-picker-in-your-react-native-projects-daedc55cc4c4
A searchable dropdown component to select a country code for your phone number input.
This component is not supported in the managed workflow for expo for the time being.
npm install @digieggs/rn-country-code-picker
or
yarn add @digieggs/rn-country-code-picker
Also you need to manually install react-native-svg
and react-native-localize
libraries for the icons in the component
npm install react-native-svg react-native-localize
or
yarn add react-native-svg react-native-localize
As react-native@0.60.0 or above supports autolinking, so there is no need to run linking process. Read more about autolinking here.
CocoaPods on iOS needs this extra step
npx pod-install
No additional step is required.
First of all, import the component.
import { CallingCodePicker } from '@digieggs/rn-country-code-picker';
Then use it like this.
const [selectedCallingCode, setSelectedCallingCode] = useState('');
return <CallingCodePicker onValueChange={callingCode => setSelectedCallingCode(callingCode)} />;
initialCountryCode
onValueChange
togglerContainerStyle
togglerLabelStyle
listContainerStyle
searchInputStyle
listStyle
pickerItemLabelStyle
pickerItemContainerStyle
style
isFlagVisible
initialCountryCode
the ISO 3166-1 alpha-2 code (FR, US, CA) of the country that you would like to show initially. If you don't pass a value to this, the country code based on your device locale will be used.
Type | Required |
---|---|
string | no |
onValueChange
Callback for when a country is selected.
callingCode
: the calling code of the selected countryType | Required |
---|---|
function | Yes |
togglerContainerStyle
Style to apply to the toggler container.
Type | Required |
---|---|
StyleProp | No |
togglerLabelStyle
Style to apply to the picker toggler label.
Type | Required |
---|---|
StyleProp | No |
listContainerStyle
Style to apply to the list container.
Type | Required |
---|---|
StyleProp | No |
searchInputStyle
Style to apply to the search input.
Type | Required |
---|---|
StyleProp | No |
listStyle
Style to apply to the FlatList component.
Type | Required |
---|---|
StyleProp | No |
pickerItemLabelStyle
Style to apply to each of the item labels.
Type | Required |
---|---|
StyleProp | No |
pickerItemContainerStyle
Style to apply to each of the item container.
Type | Required |
---|---|
StyleProp | No |
style
Style to apply to container.
Type | Required |
---|---|
StyleProp | No |
isFlagVisible
Visibility of flag component.
Type | Required |
---|---|
boolean | No |
FAQs
A searchable dropdown component to select a country code for your phone number input.
The npm package @digieggs/rn-country-code-picker receives a total of 123 weekly downloads. As such, @digieggs/rn-country-code-picker popularity was classified as not popular.
We found that @digieggs/rn-country-code-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.