Country & City Selector
Popovers with in-panel search (same pattern as Phone Input). Compose country, optional state, and optional city. Data loads on demand — light state shards first; city shards only when a city field needs them.
Country + state + city
Full cascade. States load a light shard; cities wait until a state is chosen.
Loading…
Installation
CLI
Also needs
npx @sonojs/ui@latest add input-group popovernpm i @sonojs/geo lucide-reactUsage
country-city-selector
CountrySearchSelect
Exported for custom layouts. Docs examples use CountryCitySelect only.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | string · null | - | Controlled ISO-3166 alpha-2 (CountrySearchSelect only). |
| showFlags | boolean | - | Flags in the country popover list. |
| geoDataBaseUrl | string | - | Geo data base URL (jsDelivr default). |
CountryCitySelect
| Prop | Type | Default | Description |
|---|---|---|---|
| includeState | boolean | - | Show state/province after country. |
| includeCity | boolean | - | Show city. With `includeState`, city waits for a state. |
| country / defaultCountry | string · null | - | ISO-3166 alpha-2. |
| stateId / defaultStateId | number · null | - | State id when `includeState` is true. |
| cityId / defaultCityId | number · null | - | City id when `includeCity` is true. |
| onCountryChange / onStateChange / onCityChange | callbacks | - | Downstream values clear when a parent field changes. |
| showFlags | boolean | - | Country flags in the country popover. |
| geoDataBaseUrl | string | - | Shard base for all fields. |
| disabled | boolean | - | Disable all controls. |