Location Input

Country and state picker with search, backed by bundled countries and states data.

Location Input

Country and state picker with search, backed by bundled countries and states data.

Preview

Features

  • Country search with flag + country name.
  • State list automatically filtered by selected country.
  • Controlled callbacks for form integrations.

Installation

npx shadcn@latest add https://www.shadcn-form.com/r/location-input.json

The CLI installs every dependency listed in the registry item.

Usage

import LocationSelector from '@/components/ui/location-input'
<LocationSelector
onCountryChange={(country) => setCountry(country?.name ?? '')}
onStateChange={(state) => setState(state?.name ?? '')}
/>