A customizable select, which has all the provinces in Iran.
npm i iran-province
import IranProvince from 'iran-province';
const App = () => (
<>
<IranProvince
onChange={(province) => {
console.log(province);
}}
/>
;
</>
);
export default App;
Common props you may want to specify include:
label
- apply name to the selectdisabled
- handle if it should be disabledlabelClass
- apply a className to the labelautoFocus
- focus the control when it mountsselectClass
- apply a className to the selectoptionClass
- apply a className to the optionsclassName
- apply a className to the containerlanguage
- you can choose between persian and englishonChange
- handle what happens after changing a valueform
- defines which form the drop-down list belongs toplaceholder
- change the text displayed when no option is selected
interface IProvince {
id: string;
persian: string;
english: string;
latitude: number;
longitude: number;
isCapital?: boolean;
population: number;
}
MIT Licensed. Copyright (c) 2023 Shirin apr