## Toolbar with grouped panels (Maximum open: 2)

Panels can be added to a group. Groups are used to configure specific behaviors on multiple panels. To add a panel to a group, use the `$mdPanel.newPanelGroup` method, or simply add a group name to the configuration object passed into the `$mdPanel.create` method.

Grouping allows for methods to be applied to several panels at once, i.e. closing all panels within the toolbar group, or destroying all panels within a dialog group. With the `maxOpen` property, you can also limit the number of panels allowed open within a specific group. This can be useful in limiting the number of menu panels allowed open at a time, etc.

## Multiple Groups

Panels can be added to multiple groups. The `groupName` parameter in the panel configuration can be a string or an array of strings. This allows for the functionality or constraints of multiple groups to apply to each created panel.

To give an example, the menus within the toolbar above have been added to the toolbar and menus groups. The menus to the right have been added to the menus group as well. The maximum number of open panels within the toolbar group is 2. Within the menus group it is 3. Opening the menus to the right and more than one in the toolbar will result in the first opened panel to the right to close.