Skip to content

Commit

Permalink
Add MenuGroup design documentation (#14466)
Browse files Browse the repository at this point in the history
* Update MenuGroup Readme.

Add design guidelines and screenshots.

* Adjust introduction to be more concise.
  • Loading branch information
kjellr authored and youknowriad committed Mar 20, 2019
1 parent 95f818c commit 503386d
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion packages/components/src/menu-group/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# MenuGroup

## Usage
`MenuGroup` wraps a series of related `MenuItem` components into a common section.

![MenuGroup Example](https://wordpress.org/gutenberg/files/2019/03/MenuGroup.png)

1. MenuGroup

## Table of Contents

1. [Design guidelines](#design-guidelines)
2. [Development guidelines](#development-guidelines)
3. [Related components](#related-components)

## Design guidelines

### Usage

A `MenuGroup` should be used to indicate that two or more individual MenuItems are related. When other menu items exist above or below a `MenuGroup`, the group should have a divider line between it and the adjacent item. A MenuGroup can optionally include a label to describe its contents.

![MenuGroup diagram with label and dividers](https://wordpress.org/gutenberg/files/2019/03/MenuGroup-Anatomy.png)

1. MenuGroup label
2. MenuGroup dividers

## Development guidelines

### Usage

```jsx
import { MenuGroup, MenuItem } from '@wordpress/components';
Expand All @@ -12,3 +37,9 @@ const MyMenuGroup = () => (
</MenuGroup>
);
```

## Related Components

- `MenuGroup`s are intended to be used in a `DropDownMenu`.
- To use a single button in a menu, use `MenuItem`.
- To allow users to toggle between a set of menu options, use `MenuItemsChoice` inside of a `MenuGroup`.

0 comments on commit 503386d

Please sign in to comment.