Location Picker - React Component | Kokonut UI
Location Picker
Set a pickup point the way ride apps do. Drag the map under a fixed pin; it lifts off its shadow, glides onto the nearest curb, drops, and the street rolls in.
Install with
npx shadcn@latest add https://kokonutui.com/r/location-picker.json
lucide-react, motion
Installation
Location Picker is a free, open-source React component in the Kokonut UI Inputs collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/location-picker.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/location-picker
Or add it by hand: install its packages, then copy the source above into components/kokonutui/location-picker.tsx.
npm install lucide-react motion
Usage
import LocationPicker from "@/components/kokonutui/location-picker";
export default function Example() {
return <LocationPicker />;
}
Props
onConfirm
(pickup: { address: string; x: number; y: number }) => void- Called with the street address when the pickup is confirmed.
className
string- Extra classes for the root element.
Dependencies
| Needs | Version | Comes from |
|---|---|---|
lucide-react |
^0.556.0 |
npm, installed by the CLI |
motion |
^12.23.25 |
npm, installed by the CLI |
cn from lib/utils.ts |
shadcn init | |
| React | 19 |
Your app |
| Tailwind CSS | 4 |
Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.