# Place Autocomplete URL: /docs/web/components/place-autocomplete Place Autocomplete component with multiple variants and sizes. **Demo:** ```tsx 'use client'; import { useCallback, useState } from 'react'; import { PlaceAutocomplete, type PlaceFeature } from '@docyrus/ui/components/place-autocomplete'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@docyrus/ui/primitives/ui/select'; import { Switch } from '@docyrus/ui/primitives/ui/switch'; import { cn } from '@docyrus/ui/primitives/lib/utils'; export function PlaceAutocompleteDemo() { type Variant = 'default' | 'outline' | 'ghost'; type Size = 'default' | 'sm' | 'lg'; const [variant, setVariant] = useState
Size
{selected ? (

{selected.properties.name || selected.properties.street}

Lat: {selected.geometry.coordinates[1].toFixed(6)}, Lng: {selected.geometry.coordinates[0].toFixed(6)}

{selected.properties.city && (

City: {selected.properties.city}

)} {selected.properties.country && (

Country: {selected.properties.country}

)}
) : null}
); } ``` ## Installation ```bash pnpm dlx @docyrus/cli add @docyrus/ui-place-autocomplete ``` **Dependencies:** - [class-variance-authority](https://www.npmjs.com/package/class-variance-authority) - [lucide-react](https://www.npmjs.com/package/lucide-react) ## Usage ```tsx import { PlaceAutocomplete } from "@docyrus/ui/components/place-autocomplete"; {}} onPlaceSelect={() => {}} onResultsChange={(results: PlaceFeature) = void[]} /> ``` ## Variants | Variant | Description | |---------|-------------| | `default` | Default style | | `outline` | Outline — `border-border focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50` | | `ghost` | Ghost — `border-transparent shadow-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50` | ## Sizes | Size | Description | |------|-------------| | `sm` | Small — `h-8 px-2 text-xs` | | `default` | Default — `h-9 px-2.5 text-sm` | | `lg` | Large — `h-11 px-3 text-base` | ## API Reference | Prop | Type | Default | |------|------|---------| | `variant` | `"default"` \| `"outline"` \| `"ghost"` | `"default"` | | `size` | `"sm"` \| `"default"` \| `"lg"` | `"default"` | | `ref` | `Ref` | — | | `debounceMs` | `number` | — | | `value` | `string` | — | | `defaultValue` | `string` | — | | `onChange` | `(value: string) => void` | — | | `onPlaceSelect` | `(feature: PlaceFeature) => void` | — | | `onResultsChange` | `(results: PlaceFeature[]) => void` | — | | `className` | `string` | — |