Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilad Gray committed Jan 30, 2018
1 parent 46fe754 commit f678135
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions packages/core/src/components/menu/menu.md
Expand Up @@ -81,27 +81,32 @@ Use `MenuDivider` to separate menu sections. Optionally, add a title to the divi

To add a submenu to a `Menu`, simply nest `MenuItem`s within another `MenuItem`.
The submenu opens to the right of its parent by default, but will adjust and flip to the left if
there is not enough room to the right.
there is not enough room to the right. `Menu` provides two `submenu` props to adjust this flipping behavior:
you can customize the boundary element and the padding within that boundary element.

```jsx
<MenuItem text="Submenu">
<MenuItem text="Child one" />
<MenuItem text="Child two" />
<MenuItem text="Child three" />
</MenuItem>
<Menu>
<MenuItem text="Submenu">
<MenuItem text="Child one" />
<MenuItem text="Child two" />
<MenuItem text="Child three" />
</MenuItem>
</Menu>
```

Alternatively, you can pass an array of `IMenuItemProps` to the `submenu` prop:

```jsx
React.createElement(MenuItem, {
submenu: [
{ text: "Child one" },
{ text: "Child two" },
{ text: "Child three" },
],
text: "parent",
});
React.createElement(Menu, {},
React.createElement(MenuItem, {
submenu: [
{ text: "Child one" },
{ text: "Child two" },
{ text: "Child three" },
],
text: "parent",
}),
);
```

<div class="pt-callout pt-intent-warning pt-icon-warning-sign">
Expand Down

1 comment on commit f678135

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs

Preview: documentation | landing | table

Please sign in to comment.