nepal-places-react
v0.3.0
Published
React dropdown component for Nepal's provinces, districts, municipalities, and wards. Fast, typed, bilingual.
Maintainers
Readme
nepal-places-react
React dropdown component for Nepal's Provinces, Districts, Municipalities, Wards, and Places. Built on top of nepal-places.
npm install nepal-places-reactUsage
import { NepalPlacesDropdown } from 'nepal-places-react'
function AddressForm() {
return (
<NepalPlacesDropdown
depth={3}
onChange={(selection) => console.log(selection)}
/>
)
}Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| depth | 1-5 | 2 | Number of cascade levels |
| mode | 'cascade' | 'flat' | 'cascade' | Selection mode |
| labels | 'english' | 'nepali' | 'english' | Display language |
| flat | boolean | false | Return flat code string |
| filterType | LocalLevelType | — | Filter by local level type |
| searchable | boolean | true | Enable search |
| clearable | boolean | false | Show clear button |
| disabled | boolean | false | Disable the dropdown |
| placeholder | string | — | Input placeholder text |
| onChange | (value) => void | — | Selection callback |
Depth levels
| Depth | Levels |
|-------|--------|
| 1 | Province |
| 2 | Province → District |
| 3 | Province → District → Municipality |
| 4 | Province → District → Municipality → Ward |
| 5 | Province → District → Municipality → Ward → Place |
License
MIT — kushal1o1
