https://github.com/ixzzd/bs-react-dropdown
BuckleScript binding for react-dropdown
https://github.com/ixzzd/bs-react-dropdown
bucklescript-bindings react-dropdown
Last synced: about 1 year ago
JSON representation
BuckleScript binding for react-dropdown
- Host: GitHub
- URL: https://github.com/ixzzd/bs-react-dropdown
- Owner: ixzzd
- Created: 2019-03-20T20:28:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T16:46:36.000Z (about 7 years ago)
- Last Synced: 2025-03-05T06:57:59.432Z (about 1 year ago)
- Topics: bucklescript-bindings, react-dropdown
- Language: OCaml
- Homepage: https://www.npmjs.com/package/bs-react-dropdown
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is [Bucklescript](https://bucklescript.github.io/) bindings for [react-dropdown](https://github.com/fraserxu/react-dropdown).
# Install, [npm](https://www.npmjs.com/package/bs-react-dropdown)
```
npm install --save bs-react-dropdown
```
# Setup
Add bs-react-dropdown to `bs-depenencies` in your `bsconfig.json`!
```js
{
/* ... */
"bs-dependencies": [
"bs-react-dropdown"
],
/* ... */
}
```
# Dropdown option type
```re
type dropdownOption = {
label: string,
value: string,
className: option(string),
};
```
# Basic usage
```re
open Dropdown;
let component = ReasonReact.statelessComponent(__MODULE__);
let options: dropdownOptions = [|
{label: "label1", value: "value1", className: Some("class1")},
{label: "label2", value: "value2", className: Some("class2")},
|];
let make = _children => {
...component,
render: self => {
;
},
};
```
Check reducer component [example](https://github.com/ixzzd/bs-react-dropdown/tree/master/examples/reducer_component.re)