0.4.0 • Published 3 years ago
iran-province v0.4.0
iran-province
A customizable select, witch has all the provinces in Iran.
Installation
npm i iran-provinceUsage
import IranProvince from 'iran-province';
const App = () => (
<>
<IranProvince
onChange={(e) => {console.log(e)}}
/>;
</>
);
export default App;Props
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
Provinces type
interface IProvince {
id: string;
persian: string;
english: string;
latitude: number;
longitude: number;
isCapital: boolean;
population: number;
}License
MIT Licensed. Copyright (c) 2023 Shirin apr