Menu
Menus provide a way for users to navigate your application.
Examples
Horizontal
Vertical
import React from 'react';
import ReactDOM from 'react-dom';
import { Menu, MenuItem } from 'furl-components';
ReactDOM.render(
<div>
<Menu type='horizontal'>
<MenuItem href='#item1'>Item 1</MenuItem>
<MenuItem selected href='#item2'>Item 2</MenuItem>
<MenuItem href='#item3'>Item 3</MenuItem>
<MenuItem>
<Dropdown title='Item 4 (Dropdown)'>
<MenuItem>Item 4.1</MenuItem>
<MenuItem>Item 4.2</MenuItem>
<MenuItem>Item 4.3</MenuItem>
</Dropdown>
</MenuItem>
</Menu>
<Menu type='vertical' highlight='right' data={[
'Item 1', { selected: true, title: 'Item 2' }, 'Item 3', 'Item 4'
]} />
</div>,
document.getElementById('root')
);API
| Property | Description | Type | Default | ||
|---|---|---|---|---|---|
| type | menu orientation | string | 'horizontal' | ||
| highlight | menu highlight position | string | 'top' | ||
| Property | Description | Type | Default | ||
|---|---|---|---|---|---|
| href | menu item hyperlink url | string | |||
| openIn | target of the menu item> | string | 'self' | ||
| selected | menu item selected style | boolean | false | ||
| onClick | menu item onclick event> | function | |||
Notes
- You can populate a menu either via passing children to it or via the use of the
dataprop. Ifdatais provided, it will take precedence over passed children, therefore rendering only the content provided indata. - A
Menuonly accepts children of theMenuItemcomponent type. dataonly accepts an array of values, each of which can either be a string or an object. Objects in thedataarray must contain atitle, optionally aselectedvalue and any other props that you want to pass.- A
MenuItemcan contain aDropdownas its single child.Dropdownis integrated withMenuto provide a consistent user experience. typecan be either'horizontal'or'vertical'.highlightcan be either'top'or'bottom', whentypeis'horizontal'.highlightcan be either'left'or'right', whentypeis'vertical'.openInaccepts the following values:'self','blank'or'external'.
