0.3.8 • Published 8 years ago
react-vui-dropdown v0.3.8
react-vui-dropdown
A react component to display a dropdown menu.
Installation
Install from NPM:
npm install react-vui-dropdown
Install from Bower:
bower install react-vui-dropdown
Usage
Import the style:
@import "bower_components/react-vui-dropdown/dropdown.scss"; // or...
@import "node_modules/react-vui-dropdown/dropdown.scss";
The dropdown takes the following properties:
text
: required, the text to be displayed in the dropdown buttonisPrimary
: optional flag indicating whether opener is primary buttonisTextVisible
: optional flag for whether the text is visibledisabled
: optional flag for whether the dropdown button is enableditems
: optional array of items for the menu
var dropdown = require('react-vui-dropdown'),
ButtonMenu = dropdown.ButtonMenu,
ContextMenu = dropdown.ContextMenu;
var items = [
{ "text": "Action Item 1", "action": someFunction},
{ "text": "Action Item 2", "action": someFunction, "isEnabled": false}
];
<ButtonMenu text="Stuff" items={items} />
<ButtonMenu text="Stuff" items={items} disabled />
<ContextMenu text="Stuff" items={items} />
Contributing
Code Style
This repository is configured with EditorConfig rules and contributions should make use of them. See the VUI Best Practices & Style Guide for more information.