npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-dialer-code-picker

v1.0.3

Published

Multi-language country dialer code picker with advanced search functionality, optimized performance, and customizable templates for React Native and Expo. Inspired by react-native-country-codes-picker but enhanced for better performance and issue-free exp

Downloads

576

Readme

react-native-dialer-code-picker ⚡⚡⚡

This library offers a multi-language country dialer code picker with advanced search functionality, delivering a smooth and high-performance user experience. Designed to be fully cross-platform, it supports React Native and Expo out of the box.

🚀 Built for Performance: Enhanced with optimized rendering and efficient animations for seamless navigation using FlashList.
🐞 Issue-Free Experience: Developed with careful attention to detail, addressing common issues found in similar libraries.
🔄 Flexible & Customizable: Easily adaptable to your design needs with custom templates and styling options.

Inspired by the popular react-native-country-codes-picker, but enhanced with better performance and stability. If you're looking for a modern alternative with optimized rendering and customization capabilities, this is the picker for you.

Looking for a specific country or locale? Feel free to contribute with a PR. ⚡⚡⚡


🚀 Installation

You can install it using npm or yarn:

# Using npm
npm install react-native-dialer-code-picker @shopify/flash-list

# Using yarn
yarn add react-native-dialer-code-picker @shopify/flash-list

Note: This library uses FlashList from @shopify/flash-list for improved performance, so make sure to install it as a dependency.


⚙️ Basic Usage

Using DialerPicker (Built-in Modal)

The DialerPicker component includes a built-in modal, so you can directly use it without handling modal logic manually.

import React, { useState } from 'react';
import { View, Button, Text } from 'react-native';
import { DialerPicker } from 'react-native-dialer-code-picker';

const App = () => {
  const [isVisible, setIsVisible] = useState(false);
  const [selectedDialer, setSelectedDialer] = useState('');

  const handleDialerSelect = (item) => {
    setSelectedDialer(item.dial_code);
    setIsVisible(false);
  };

  return (
    <View>
      <Button title="Select Dialer Code" onPress={() => setIsVisible(true)} />
      <Text>Selected Dialer Code: {selectedDialer}</Text>
      <DialerPicker
        isVisible={isVisible}
        onDialCodeSelect={handleDialerSelect}
        onClose={() => setIsVisible(false)}
        searchPlaceholder="Search by country or code"
        lang="en"
      />
    </View>
  );
};

export default App;

💡 Advanced Usage

Using DialerList (Custom Modal or Bottom Sheet)

If you want to use your own modal (e.g., BottomSheetModal), you can import DialerList and handle the modal separately.

import React, { useState, useCallback } from 'react';
import { View, Button } from 'react-native';
import { DialerList } from 'react-native-dialer-code-picker';
import {
  BottomSheetModal,
  BottomSheetModalProvider,
} from '@gorhom/bottom-sheet';

const BottomSheetDialer = () => {
  const [bottomSheetRef, setBottomSheetRef] = useState(null);

  const openSheet = useCallback(() => {
    bottomSheetRef?.present();
  }, [bottomSheetRef]);

  return (
    <BottomSheetModalProvider>
      <View>
        <Button title="Open Dialer" onPress={openSheet} />
        <BottomSheetModal
          ref={setBottomSheetRef}
          index={0}
          snapPoints={['50%']}
        >
          <DialerList
            onDialCodeSelect={(item) => {
              console.log(item.dial_code);
              bottomSheetRef?.dismiss();
            }}
            lang="en"
          />
        </BottomSheetModal>
      </View>
    </BottomSheetModalProvider>
  );
};

Comparison: DialerPicker vs. DialerList

| Feature | DialerPicker (Built-in Modal) | DialerList (Standalone) | | ---------------------- | ------------------------------- | ------------------------- | | Includes a modal? | ✅ Yes | ❌ No | | Manages its own state? | ✅ Yes | ❌ No | | Custom modal support? | ❌ No, uses default modal | ✅ Yes | | Ideal for...? | Quick implementation | Full customization |


📚 Props and API Details

DialerPicker Props

| Prop | Type | Description | Required | Default | | -------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------ | -------- | -------------- | | isVisible | boolean | Controls the visibility of the modal. | ✅ | false | | enableModalAvoiding | boolean | Enables keyboard avoiding behavior on Android. | ❌ | false | | disableBackdrop | boolean | If true, disables the backdrop behind the modal. | ❌ | false | | androidWindowSoftInputMode | string | Defines keyboard behavior on Android (e.g., "pan"). | ❌ | - | | searchPlaceholder | string | Placeholder text for the search input. | ❌ | "Search..." | | searchPlaceholderTextColor | string | Color of the placeholder text in the search input field. | ❌ | - | | searchNotFoundMessage | string | Message displayed when no results are found. | ❌ | - | | lang | string | Selected language for country names. | ✅ | "en" | | defaultDialCode | string | Default dial code to be pre-selected. | ❌ | - | | otherCountriesHeaderTitle | string | Title for the "Other Countries" section. | ❌ | - | | searchContainerStyle | StyleProp<ViewStyle> | Custom styles for the search input container. | ❌ | - | | excludedCountries | string[] | List of country codes to exclude from the picker. | ❌ | [] | | showOnly | string[] | List of country codes to exclusively show. | ❌ | [] | | popularCountries | string[] | List of popular countries to show at the top. | ❌ | [] | | onDialCodeSelect | (item: DialerCode) => void | Callback when a dialer code is selected. | ✅ | - | | onBackdropPress | () => void | Callback when the backdrop is pressed. | ❌ | - | | onClose | () => void | Callback when the modal is closed. | ❌ | - | | itemTemplate | (props: DialerItemTemplateProps) => JSX.Element | Custom template to render each item. | ❌ | DialerButton | | headerComponent | (props: DialerListHeaderComponentProps) => JSX.Element | Custom component for the list header. | ❌ | - | | style | DialerStyle | Style object to customize the picker. | ❌ | - | | showVerticalScrollIndicator | boolean | Whether to show the vertical scroll indicator. Default is false. | ❌ | false |

DialerList Props

| Prop | Type | Description | Required | Default | | -------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------ | -------- | -------------- | | excludedCountries | string[] | List of country codes to exclude. | ❌ | [] | | showOnly | string[] | List of country codes to exclusively show. | ❌ | [] | | popularCountries | string[] | List of popular country codes displayed at the top. | ❌ | [] | | onDialCodeSelect | (item: DialerCode) => void | Callback triggered when a dial code is selected. | ✅ | - | | lang | string | Language code for country names. | ✅ | "en" | | headerComponent | (props: DialerListHeaderComponentProps) => JSX.Element | Custom component for the list header. | ❌ | - | | itemTemplate | (props: DialerItemTemplateProps) => JSX.Element | Custom component for rendering each item. | ❌ | DialerButton | | style | DialerStyle | Style object to customize the component. | ❌ | - | | searchContainerStyle | StyleProp<ViewStyle> | Custom styles for the search container. | ❌ | - | | showVerticalScrollIndicator | boolean | Whether to show the vertical scroll indicator. Default is false. | ❌ | false | | searchValue | string | Text input for filtering countries by name or dial code. | ❌ | - |


📝 License

This project is licensed under the MIT License.
See the LICENSE file for more details.


🤝 Contributions

Contributions are welcome!
If you find a bug or want to add a new feature, please open an Issue or a Pull Request.