Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@digieggs/react-native-calling-code-picker
Advanced tools
A searchable dropdown component for selecting a country code for your phone number input.
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/react-native-calling-code-picker --save
or
yarn add @digieggs/react-native-calling-code-picker
Also you need to manually install react-native-svg
library for the icons in the component
npm install react-native-svg --save
or
yarn add react-native-svg
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 'react-native-calling-code-picker';
Then use it like this.
const [selectedCallingCode, setSelectedCallingCode] = useState('90'); // Give it a default value to show an initial flag and a code
return (
<CallingCodePicker
selectedValue={selectedCallingCode}
onValueChange={value => setSelectedCallingCode(value)}
/>
);
selectedValue
onValueChange
containerStyle
pickerTogglerLabelStyle
listContainerStyle
searchInputStyle
listStyle
pickerItemLabelStyle
selectedValue
Value matching value of one of the items. Can be a string.
Type | Required |
---|---|
string | Yes |
onValueChange
Callback for when an item is selected. This is called with the following parameters:
itemValue
: the value of the item that was selectedType | Required |
---|---|
function | Yes |
togglerContainerStyle
Style to apply to the toggler container container. (for ex. you can give absolute positioning to align it inside the input.)
Type | Required |
---|---|
StyleProp | No |
togglerLabelStyle
SStyle 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 |
FAQs
A searchable dropdown component for selecting a country code for your phone number input.
We found that @digieggs/react-native-calling-code-picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.