Components

Place Autocomplete

Place Autocomplete component with multiple variants and sizes.

Client Only

Installation

pnpm dlx @docyrus/cli add @docyrus/ui-place-autocomplete
UI Primitives(2 components)
npx shadcn@latest add command spinner

Usage

import {
  PlaceAutocomplete
} from "@docyrus/ui/components/place-autocomplete";

<PlaceAutocomplete
  variant="default"
  size="sm"
  ref={...}
  debounceMs={0}
  value="..."
  defaultValue="..."
  onChange={() => {}}
  onPlaceSelect={() => {}}
  onResultsChange={(results: PlaceFeature) = void[]}
/>

Variants

VariantDescription
defaultDefault style
outlineOutline — border-border focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50
ghostGhost — border-transparent shadow-none focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50

Sizes

SizeDescription
smSmall — h-8 px-2 text-xs
defaultDefault — h-9 px-2.5 text-sm
lgLarge — h-11 px-3 text-base

API Reference

PropTypeDefault
variant"default" | "outline" | "ghost""default"
size"sm" | "default" | "lg""default"
refRef<HTMLInputElement>—
debounceMsnumber—
valuestring—
defaultValuestring—
onChange(value: string) => void—
onPlaceSelect(feature: PlaceFeature) => void—
onResultsChange(results: PlaceFeature[]) => void—
classNamestring—

On this page