the-menu
Menu of the-components
Installation
$ npm install the-menu --save
Usage
Live Demo is hosted on GitHub Page
'use strict' PureComponent { const s = this const ExampleMenu = <TheMenu grid=grid> <TheMenuItem icon='fa fa-support' text='Help' to='/help'/> <TheMenuItem icon='fa fa-info-circle' text='About' to='/about'/> <TheMenuItem icon='fa fa-sign-out' text='Logout' onClick= console/> <TheMenuItem icon='fa fa-sun-o' text='Foo'/> <TheMenuItem icon='fa fa-sun-o' text='Bar'/> <TheMenuItem icon='fa fa-sun-o' text='Baz'/> </TheMenu> return <div> <TheRouterHash> <TheMenuStyle/> <h3>Default Menu</h3> <div> <ExampleMenu/> </div> <hr/> <h3>Grid Menu</h3> <div> <ExampleMenu grid/> </div> <hr/> <h3>Drop Down</h3> <TheDropdownMenu label='Try me!' > <TheDropdownMenuItem to='foo'>foo</TheDropdownMenuItem> <TheDropdownMenuItem to='bar'>bar</TheDropdownMenuItem> <TheDropdownMenuItem>baz</TheDropdownMenuItem> <TheDropdownMenuItem to='quz'>quz</TheDropdownMenuItem> <TheDropdownMenuItem>1</TheDropdownMenuItem> <TheDropdownMenuItem>2</TheDropdownMenuItem> <TheDropdownMenuItem>Long Long Long Long Long Text</TheDropdownMenuItem> </TheDropdownMenu> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> </TheRouterHash> </div> }
Components
TheDropDownMenu
Drop down menu
Props
Name | Type | Description | Default |
---|---|---|---|
eventsToClose |
arrayOf string | Event types to close for | ['hashchange'] |
label |
node | Label for toggle button | `` |
open |
bool | Open when mounted | false |
righted |
bool | Show on righthand | false |
role |
'menu' |
TheMenu
Menu of the-components
Props
Name | Type | Description | Default |
---|---|---|---|
grid |
bool | Grid layout | false |
role |
'menu' |
TheMenuItem
Menu of the-components
Props
Name | Type | Description | Default |
---|---|---|---|
active |
bool | Active or not | false |
icon |
string | Icon class name | null |
to |
string | Link to | null |
role |
'menuitem' |
TheMenuStyle
Style for TheMenu
Props
Name | Type | Description | Default |
---|---|---|---|
options |
object | Style options | {} |
License
This software is released under the MIT License.