package
Dropdown menu from Talk by teambition
npm install react-lite-dropdownGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 3 packages.
197.5 kB
Includes dependencies.
Dropdown component from Talk by Teambition.
Demo http://ui.talk.ai/react-lite-dropdown/
####Dropdown
displayText (string)Text to display when selected. You will get is-chosen in className of root element when it's specified.
defaultText (string.isRequired)Text to display when displayText is undefined.
name (string)CSS hook for this components, defaults to default. Suppose it's x, the generated className is is-for-x.
show (bool.isRequired)Defines whether DropdownMenu is shown or not.
onToggle (func.isRequired)Things happened when toggle dropdown.
this.props.childrenContent to render in the menu opened after clicked.
This component suppose you are using it in such scenarios:
<select>, with default text and selectedwindow and menu is then closedIn chinese. 中文表达更明确一些, 这个组件做了一些假定, 使用需要注意:
<select>, 有 选中/未选中 状态, 用 CSS hook 修改颜色this.props.children 传入npm i --save react-lite-dropdownRead src/main.jsx(compiles with Babel) for details:
import {default as React} from 'react';
import './demo.css';
import {default as LiteDropdown} from 'react-lite-dropdown';
import 'react-lite-dropdown/src/style.css'; // CSS if you need
var languages = 'CoffeeScript PureScript Elm CirruScript'.split(' ');
var App = React.createClass({
displayName: 'page-app',
getInitialState: function() {
return {
lang: undefined
};
},
onItemClick: function
npm iYou need a static file server for the HTML files. Personally I suggest using Nginx.
Develop:
gulp html # regenerate index.html
webpack-dev-server --hot # enable live-reloadingBuild (Pack and optimize js, reivision js and add entry in index.html):
gulp buildMIT
sunebear
hi@sunebear.com