reac-custom-select

React custom select

Get the code: Github Repo

React custom select gives you a simple boiler plate for fully customizable select/option groups without having to battle with native styles. Because it’s a react component you can easily integrate it with an existing react or flux style project.

Usage & Installation:

* Clone / Download this repo.
* Install customSelect.react.js as a component into your project.
* Include CustomSelect and use.
* Done!

How to setup:

1) Install customSelect.react as a component
2) Include CustomSelect
2) Define your customSelect

1
2
3
4
5
6
7
8
9
10
11
12
13
```
/*
  static propTypes = {
    options: React.PropTypes.array.required,
    onSelect: React.PropTypes.func
  };
*/

<CustomSelect
  options={_options}
  onSelect={(value) => this.updateForm(value)}
  />
```

3) Define your options:

1
2
3
4
5
6
7
/* Array of your selectOptions */
const selectOptions = [
  {text: 'one', value: 1},
  {text: 'two', value: 2},
  {text: 'three', value:3},
  {text: 'three', value:4}
];

4) Define your callback: (optional)
This allows you to send a callback to when the value is changed.

Contributing

It doesn’t matter if you’re a veteran or not. Everyone brings something awesome to the party so please contribute.
If you have any questions or suggestions give a shout out on twitter
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am ‘Add some feature’`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request 😀

Credits

Created and maintained by [@rorykermack](https://twitter.com/@rorykermack)

License

[WTFPL](http://www.wtfpl.net/) (100% Open Source)

Rory K

Rory Kermack is a professional programmer, interactive designer, and entrepreneur. Working with the #iot, #hybridapps, #webrtc & #reactjs. Senior dev & main contributor of codeanthology.