UNPKG

lucid-ui

Version:

A UI component library from AppNexus.

30 lines 1.18 kB
import React from 'react'; import createClass from 'create-react-class'; import { SearchableSelect } from '../../../index'; var Placeholder = SearchableSelect.Placeholder, Option = SearchableSelect.Option, SearchField = SearchableSelect.SearchField; export default createClass({ getInitialState: function getInitialState() { return { selectedIndex: null }; }, handleSelect: function handleSelect(optionIndex) { this.setState({ selectedIndex: optionIndex }); }, render: function render() { return /*#__PURE__*/React.createElement("section", { style: { marginBottom: '20px' } }, /*#__PURE__*/React.createElement(SearchableSelect, { onSelect: this.handleSelect, maxMenuHeight: "200" }, /*#__PURE__*/React.createElement(SearchField, { placeholder: "Type here to filter..." }), /*#__PURE__*/React.createElement(Placeholder, null, "Select Color"), /*#__PURE__*/React.createElement(Option, null, "Blue"), /*#__PURE__*/React.createElement(Option, null, "Green"), /*#__PURE__*/React.createElement(Option, null, "Orange"), /*#__PURE__*/React.createElement(Option, null, "Red"))); } });