TELPICK

Build Your Phone Selector Easily

Multi-platform country and phone code selector with a modern design, smooth animations, and automatic IP detection.

npm

Install with npm

npm install telpick

pnpm

Install with pnpm

pnpm add telpick

yarn

Install with yarn

yarn add telpick

CDN

Include from CDN

<script src="https://unpkg.com/telpick@latest/dist/telpick.umd.js"></script>

Interactive Demo

Click on the selector to try it. The component automatically detects your country by IP.

Code
Phone
Country
ISO

Installation and usage Telpick

After installing the package, import the CSS styles and the component according to your framework.

# Install the package
npm install telpick

# Import CSS styles (required)
import 'telpick/dist/style.css'

# Import component
import { TelpickReact } from 'telpick/react'
// React Component
import React, { useState } from 'react'
import { TelpickReact } from 'telpick/react'
import 'telpick/dist/style.css'

function App() {
  const [selectedCountry, setSelectedCountry] = useState(null)

  return (
    <TelpickReact
      code={null}
      onChange={(country) => {
        console.log('Selected country:', country)
        setSelectedCountry(country)
      }}
    />
  )
}
<!-- Vue 3 Component -->
<template>
  <TelpickVue
    :code="selectedCode"
    @update:code="handleCountryChange"
  />
</template>

<script setup>
import { ref } from 'vue'
import { TelpickVue } from 'telpick/vue'
import 'telpick/dist/style.css'

const selectedCode = ref(null)

const handleCountryChange = (country) => {
  console.log('Selected country:', country)
  selectedCode.value = country.country_code
}
</script>
<!-- HTML -->
<link rel="stylesheet" href="https://unpkg.com/telpick@latest/dist/style.css">
<div id="telpick-container"></div>
<script src="https://unpkg.com/telpick@latest/dist/telpick.umd.js"></script>

// JavaScript
const telpick = new Telpick({
  code: null,
  onChange: (country) => {
    console.log('Selected country:', country)
  }
})

telpick.init(document.getElementById('telpick-container'))