lucid-ui
Version:
A UI component library from AppNexus.
27 lines (26 loc) • 1.04 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { SearchableSelect } from '../../../index';
const { Placeholder, Option, SearchField } = SearchableSelect;
export default createClass({
getInitialState() {
return {
selectedIndex: null,
};
},
handleSelect(optionIndex) {
this.setState({
selectedIndex: optionIndex,
});
},
render() {
return (React.createElement("section", { style: { marginBottom: '20px' } },
React.createElement(SearchableSelect, { onSelect: this.handleSelect, maxMenuHeight: '200' },
React.createElement(SearchField, { placeholder: 'Type here to filter...' }),
React.createElement(Placeholder, null, "Select Color"),
React.createElement(Option, null, "Blue"),
React.createElement(Option, null, "Green"),
React.createElement(Option, null, "Orange"),
React.createElement(Option, null, "Red"))));
},
});