Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bboydflo/flagstrap-preact
flagstrap jquery plugin ported to preact
https://github.com/bboydflo/flagstrap-preact
Last synced: 3 months ago
JSON representation
flagstrap jquery plugin ported to preact
- Host: GitHub
- URL: https://github.com/bboydflo/flagstrap-preact
- Owner: bboydflo
- Created: 2017-11-12T18:50:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-12T22:34:44.000Z (about 7 years ago)
- Last Synced: 2024-09-30T06:41:31.894Z (3 months ago)
- Language: CSS
- Size: 3.72 MB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-preact - Preact Country Picker - Country picker based on bootstrap 3 made for Preact. (Uncategorized / Uncategorized)
README
## `` for Preact
A dropdown component that makes it possible to choose a country from a [list](https://github.com/bboydflo/flagstrap-preact/blob/master/src/js/countries.js). This component is suited only together with Bootstrap 3 styles and is a direct port of the [following plugin](https://github.com/blazeworx/flagstrap)
## Installation
```sh
$ npm install flagstrap-preact
```> Make sure to enable transpilation for this module! Check [.babelrc](https://github.com/bboydflo/flagstrap-preact/blob/master/.babelrc) and [webpack configuration](https://github.com/bboydflo/flagstrap-preact/blob/master/https://github.com/bboydflo/flagstrap-preact/blob/master/webpack.config.js) if you have troubles.
## Usage Example
```js
const onChanged = (countryCode) => {
console.log('new selected country: ', countryCode);
}```
#### Demo
---
## Props
| Prop | Type | Description |
|---------------------|------------|---------------------|
| **`countries`** | _Object_ | Object containing country code as keys and country names as values
| **`choose`** | _String_ | Default dropdown label.
| **`selected`** | _String_ | Default selected country code
| **`onChange`** | _Function_ | Prop to handle dropdown change outside of Flagstrap component---
### License
[MIT]
[MIT]: http://choosealicense.com/licenses/mit/