🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@julekgwa/react-native-places-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@julekgwa/react-native-places-autocomplete

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.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
175
-8.85%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-places-autocomplete

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.

npm version npm downloads license stars

Supported Providers

Try it on Expo Snack

✨ 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
Docs

📦 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

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

PropTypeDefaultDescription
fetchSuggestions(query: string) => Promise<LocationSuggestion[]>undefinedFunction to fetch location suggestions (optional when using provider)
providerLocationProvideropenstreetmapBuilt-in provider: 'openstreetmap', 'mapbox', 'google', 'geoapify', 'locationiq'
providerConfigProviderConfig{}Configuration for built-in providers (API keys, base URLs)
queryOptionsQueryOptions{limit: 10}Provider-specific query parameters
onLocationSelect(location: LocationSuggestion) => voidundefinedCallback when a location is selected
onQueryChange(query: string) => voidundefinedCallback when search query changes
placeholderstring"Search for a location..."Input placeholder text
debounceMsnumber300Debounce delay for API calls in milliseconds
showRecentSearchesbooleantrueShow recent searches when input is empty
recentSearchesstring[][]Array of recent search terms
onRecentSearchesChange(searches: string[]) => voidundefinedCallback when recent searches update
maxRecentSearchesnumber5Maximum number of recent searches to keep
containerStyleViewStyleundefinedStyle for the main wrapper container
inputContainerStyleViewStyleundefinedStyle for the input container (with search icon, input, clear button)
inputStyleTextStyleundefinedStyle for the TextInput field itself
suggestionStyleViewStyleundefinedStyle for individual suggestion items
textStyleTextStyleundefinedStyle for text elements (titles, labels)
themeDeepPartial<LocationAutocompleteTheme>{}Custom theme configuration
attributionReact.ComponentType | React.ReactElementnullAttribution 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

Keywords

react-native

FAQs

Package last updated on 15 Nov 2025

Did you know?

Socket

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.

Install

Related posts