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

@julekgwa/react-native-places-autocomplete

v1.0.2

Published

A provider-agnostic React Native autocomplete component for searching addresses and places. Supports Google Places, OpenStreetMap (Nominatim), LocationIQ, Mapbox, or any other custom API. Easy to integrate, fully customizable, and lightweight.

Readme

A provider-agnostic React Native autocomplete component for searching addresses and places. Supports multiple built-in geocoding providers including OpenStreetMap (free), OpenCage, Google Places, Mapbox, LocationIQ, Geoapify, HERE, and TomTom, or use any custom API. Easy to integrate, fully customizable, and lightweight.

✨ Features

  • 🌍 Built-in Providers - OpenStreetMap (free), OpenCage, Google Places, Mapbox, LocationIQ, Geoapify, HERE, TomTom
  • 🔧 Provider Agnostic - Works with any geocoding API or use built-in providers
  • 🎨 Fully Customizable - Complete theme and styling control
  • 📱 React Native + Web Ready - Built specifically for React Native apps
  • 🔍 Recent Searches - Built-in recent searches functionality
  • Debounced Requests - Optimized API calls with configurable debouncing
  • 🎯 TypeScript Support - Full TypeScript support with type definitions
  • 📦 Lightweight - Minimal dependencies
  • 🔤 Query Options - Customize API requests with provider-specific parameters

📦 Installation

npm install @julekgwa/react-native-places-autocomplete

Additional Setup

Since the component uses SVG icons, you'll need to install react-native-svg:

For Expo projects:

expo install react-native-svg

For bare React Native projects, follow the react-native-svg installation guide.

🚀 Quick Start

Using Built-in Providers (Recommended)

The easiest way to get started is using one of the built-in providers:

import React from 'react';
import { LocationAutocomplete } from '@julekgwa/react-native-places-autocomplete';
import type { LocationSuggestion } from '@julekgwa/react-native-places-autocomplete';

const App = () => {
  const handleLocationSelect = (location: LocationSuggestion) => {
    console.log('Selected:', location);
  };

  return (
    <LocationAutocomplete
      // Use OpenStreetMap (completely free, no API key required)
      provider="openstreetmap"
      queryOptions={{
        countrycodes: "us,ca,gb", // Limit to specific countries
        limit: 8
      }}
      placeholder="Search for a location..."
      onLocationSelect={handleLocationSelect}
      showRecentSearches={true}
    />
  );
};

Using Built-in Providers with API Keys

// Mapbox example
<LocationAutocomplete
  provider="mapbox"
  providerConfig={{
    apiKey: "YOUR_MAPBOX_TOKEN"
  }}
  queryOptions={{
    country: "us",
    types: "place,address"
  }}
  onLocationSelect={handleLocationSelect}
/>

// Google Places example
<LocationAutocomplete
  provider="google"
  providerConfig={{
    apiKey: "YOUR_GOOGLE_API_KEY"
  }}
  queryOptions={{
    components: "country:us",
    types: "geocode"
  }}
  onLocationSelect={handleLocationSelect}
/>

📝 API Reference

Props

| Prop | Type | Default | Description | |------|------|------------------------------|-------------| | fetchSuggestions | (query: string) => Promise<LocationSuggestion[]> | undefined | Function to fetch location suggestions (optional when using provider) | | provider | LocationProvider | openstreetmap | Built-in provider: 'openstreetmap', 'mapbox', 'google', 'geoapify', 'locationiq' | | providerConfig | ProviderConfig | {} | Configuration for built-in providers (API keys, base URLs) | | queryOptions | QueryOptions | {limit: 10} | Provider-specific query parameters | | onLocationSelect | (location: LocationSuggestion) => void | undefined | Callback when a location is selected | | onQueryChange | (query: string) => void | undefined | Callback when search query changes | | placeholder | string | "Search for a location..." | Input placeholder text | | debounceMs | number | 300 | Debounce delay for API calls in milliseconds | | showRecentSearches | boolean | true | Show recent searches when input is empty | | recentSearches | string[] | [] | Array of recent search terms | | onRecentSearchesChange | (searches: string[]) => void | undefined | Callback when recent searches update | | maxRecentSearches | number | 5 | Maximum number of recent searches to keep | | containerStyle | ViewStyle | undefined | Style for the main wrapper container | | inputContainerStyle | ViewStyle | undefined | Style for the input container (with search icon, input, clear button) | | inputStyle | TextStyle | undefined | Style for the TextInput field itself | | suggestionStyle | ViewStyle | undefined | Style for individual suggestion items | | textStyle | TextStyle | undefined | Style for text elements (titles, labels) | | theme | DeepPartial<LocationAutocompleteTheme> | {} | Custom theme configuration | | attribution | React.ComponentType \| React.ReactElement | null | Attribution component for your provider |

Documentation

You can view the live docs site at: https://juniusl.space/places-autocomplete

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

MIT © julekgwa

🙏 Acknowledgments