react-menu
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -0,1 +1,8 @@ | ||
v0.0.3 - Sat, 11 Oct 2014 20:51:58 GMT | ||
-------------------------------------- | ||
- [984104a](../../commit/984104a) [added] basic examples in README | ||
- [5be176c](../../commit/5be176c) [fixed] issue where components not exposed | ||
v0.0.2 - Sat, 11 Oct 2014 20:11:06 GMT | ||
@@ -2,0 +9,0 @@ -------------------------------------- |
@@ -1,1 +0,6 @@ | ||
module.exports = require('./components/Menu'); | ||
var Menu = require('./components/Menu'); | ||
Menu.MenuTrigger = require('./components/MenuTrigger'); | ||
Menu.MenuOptions = require('./components/MenuOptions'); | ||
Menu.MenuOption = require('./components/MenuOption'); | ||
module.exports = Menu; |
{ | ||
"name": "react-menu", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Accessible menu component for React.JS", | ||
"main": "./modules/index", | ||
"main": "./lib/index", | ||
"repository": { | ||
@@ -7,0 +7,0 @@ "type": "git", |
# react-menu | ||
[wip] Accessible menu component built for React.JS | ||
An accessible menu component built for React.JS | ||
## Basic Usage | ||
```html | ||
/** @jsx React.DOM */ | ||
var react = require('react'); | ||
var Menu = require('react-menu'); | ||
var MenuTrigger = Menu.MenuTrigger; | ||
var MenuOptions = Menu.MenuOptions; | ||
var MenuOption = Menu.MenuOption; | ||
var App = React.createClass({ | ||
render: function() { | ||
return ( | ||
<Menu className='myMenu'> | ||
<MenuTrigger> | ||
⚙ | ||
</MenuTrigger> | ||
<MenuOptions> | ||
<MenuOption> | ||
1st Option | ||
</MenuOption> | ||
<MenuOption onSelect={this.someHandler}> | ||
2nd Option | ||
</MenuOption> | ||
<div className='a-non-interactive-menu-item'> | ||
non-selectable item | ||
</div> | ||
<MenuOption disabled={true} onDisabledSelect={this.otherHanlder}> | ||
diabled option | ||
</MenuOption> | ||
</MenuOptions> | ||
</Menu> | ||
); | ||
} | ||
}); | ||
React.renderComponent(<App />, document.body); | ||
``` | ||
For a working example see the `examples/basic` example | ||
## Styles | ||
Bring in default styles by calling `injectCSS` on the `Menu` component. | ||
```javascript | ||
var Menu = require('react-menu'); | ||
Menu.injectCSS(); | ||
``` | ||
Default styles will be added to the top of the head, and thus any styles you write will override any of the defaults. | ||
The following class names are used / available for modification in your own stylsheets: | ||
``` | ||
.Menu | ||
.Menu__MenuTrigger | ||
.Menu__MenuOptions | ||
.Menu__MenuOption | ||
``` |
64433
1461
75