tflagpicker
v0.1.7
Published
TFlagPicker is a simple package to implement countries dial codes.
Downloads
6
Maintainers
Readme
TFlagPicker
TFlagPicker is a simple package to implement countries dial codes.
Install
for npm:
npm i tflagpicker
Setup
For setting up, simply import and use in your components:
import TFlagPicker from 'TFlagPicker';
function App() {
return (
<div className="App">
<TFlagPicker defaultCountry={"TR"}/>
</div>
);
}
export default App;
Props
| Property | Description | Data type | | searchPlaceholder | Set text of placeholder in modal search input | String | | defaultCountry | Symbol of default selected country | String | | modalDirection | ltr of rtl (default: ltr) | String |
Events
onChange: called when selected country changes. returns new selected country object. simple usage:
<TFlagPicker
defaultCountry={"TR"}
searchPlaceholder={"Search ..."}
modalDirection={"ltr"}
onChange={(country)=>console.log(country)}
/>