lucid-ui
Version:
A UI component library from AppNexus.
29 lines (28 loc) • 1.26 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { SingleSelect } from '../../../index';
var Placeholder = SingleSelect.Placeholder,
Option = SingleSelect.Option;
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", null, /*#__PURE__*/React.createElement(SingleSelect, {
isInvisible: true,
onSelect: this.handleSelect
}, /*#__PURE__*/React.createElement(Placeholder, null, "Select Color"), /*#__PURE__*/React.createElement(Option, null, "Red"), /*#__PURE__*/React.createElement(Option, null, "Green"), /*#__PURE__*/React.createElement(Option, null, "Blue")), /*#__PURE__*/React.createElement("section", {
style: {
marginTop: '10px'
}
}, "Selected Index: ", JSON.stringify(this.state.selectedIndex)));
}
}); // begin-hide-from-docs
export var notes = "\nThis removes the dropdown border. The lack of a border gives the dropdown a lighter visual weight within a data-intense layout.\n"; // end-hide-from-docs