A lightweight and accessible React component library for selecting geographic data: countries by continent, country names, and international phone codes. Built with flexibility and styled using Tailwind CSS.
- 🌐 GeoLocationPicker – Select countries grouped by continent
- 🗼 SelectCountry – Simple searchable dropdown for countries
- 📞 SelectPhoneCode – Select country phone codes with flags
- ⚡ Optimized with React's
useDeferredValuefor smooth typing - 🎨 Styled using TailwindCSS
- 📦 Zero runtime dependencies
Using npm:
npm install geo-location-pickerUsing yarn:
yarn add geo-location-pickerUsing pnpm:
pnpm add geo-location-pickerimport { GeoLocationPicker } from 'geo-location-picker';
<GeoLocationPicker onChange={(selected) => console.log(selected)} />import { SelectCountry } from 'geo-location-picker';
<SelectCountry onSelect={(country) => console.log(country)} />import { SelectPhoneCode } from 'geo-location-picker';
<SelectPhoneCode onSelect={(code) => console.log(code)} />This library uses Tailwind CSS for styling. To apply styles correctly, make sure to import the package’s styles:
import 'geo-location-picker/dist/src/index.css';Or extract and customize the styles if you're integrating into a custom Tailwind setup.
| Prop | Type | Description |
|---|---|---|
onChange |
(value: Record<string, Set<string>>) => void |
Called when country selection changes |
| Prop | Type | Description |
|---|---|---|
onSelect |
(value: string) => void |
Called when a country is selected |
| Prop | Type | Description |
|---|---|---|
onSelect |
(value: string) => void |
Called when a phone code is selected |
- Full keyboard navigation
- ARIA roles applied for dropdown inputs
- Focus ring and hover state styling
ISC