A flexible, accessible, and secure Svelte component that brings the power of Google Places search to your application in minutes.
See the component in action with default settings—start typing to experience it yourself.
Enable the Places API in the Google Cloud Console and create an API key. Learn how.
npm i places-autocomplete-svelteImport the component and add it to your page. Refer to the Basic Usage guide for complete examples.
<script>
import { PlaceAutocomplete } from 'places-autocomplete-svelte';
import type { PlaceResult } from 'places-autocomplete-svelte/interfaces';
// Get API Key securely (e.g., from environment variables)
const PUBLIC_GOOGLE_MAPS_API_KEY = import....Follows WAI-ARIA patterns with full keyboard navigation.
Safely renders suggestions to protect against XSS attacks.
Automatically handles session tokens to manage API costs.
Limits API calls while the user is typing to save requests.
Easily override styles or provide your own using props.
Written entirely in TypeScript with comprehensive type definitions.
The core logic of this component is also available as a standalone JavaScript library—places-autocomplete-js. It delivers the same robust features for any web application, regardless of your chosen framework.