iran-province
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

iran-province

A customizable select, witch has all the provinces in Iran.

Installation

npm i iran-province

Usage

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 select
  • disabled - handle if it should be disabled
  • labelClass - apply a className to the label
  • autoFocus - focus the control when it mounts
  • selectClass - apply a className to the select
  • optionClass - apply a className to the options
  • className - apply a className to the container
  • language - you can choose between persian and english
  • onChange - handle what happens after changing a value
  • form - defines which form the drop-down list belongs to
  • placeholder - 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

Package Sidebar

Install

npm i iran-province

Weekly Downloads

4

Version

0.4.0

License

MIT

Unpacked Size

371 kB

Total Files

20

Last publish

Collaborators

  • shirinapr