# Menus

{% embed url="<https://material.io/components/menus/>" %}

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1rY_CRr4z15Z2VLTm5QVqsAjWxb9TrBTQ%2Fmenu-intro.png)

## Usage&#x20;

A menu displays a list of choices on a temporary surface. They appear when users interact with a button, action, or other control.

### Principles

#### Nimble

Menus should be easy to open, close, and interact with.

#### Contextual

Menu content should be suited to user needs.

#### Scannable

Menu items should be easy to scan.

### Types

Menus allow users make a selection from multiple options. They are less prominent and take up less space than selection controls, such as a set of radio buttons.

#### Dropdown menus

Dropdown menus display a list of options, triggered by an icon, button, or action. Their placement varies based on the element that opens them.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-R3BETkhoSnlpZXM%2Foption-baseline-dropdown.png" alt=""></div>

#### Exposed dropdown menus

Exposed dropdown menus display the currently selected menu item above the list of options. Some variations can accept user-entered input.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-aUp4eDJOWW0yUFE%2Foption-exposed-line-item.png" alt=""></div>

###

### Placement

Menus appear in front of all other permanent UI elements. The maximum height of a menu should be at least one row less than the...READ MORE

#### Elevation

Menus appear in front of all other permanent UI elements.

<div align="left"><img src="https://4132241749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx-rODU78wKXcWFO5Gt%2F-Lx5aTmg4X5VNGTI4LjN%2F-Lx5bT_fZd1h5bPvgfKM%2Fimage.png?alt=media&#x26;token=8e3c0e8f-7d62-4f41-b989-a994bf6d4f5b" alt="Menus appear at a higher elevation than all other permanent UI elements."></div>

#### Height

The maximum height of a menu should be at least one row less than the height of the app’s UI.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1vMZ-REWDM4q50tWciD6AoLPXryTp9-rl%2Fmenu-length.png" alt="The rows in this menu are 32dp tall. That’s also the space used between the menu and the bottom of the screen.  "></div>

#### Position

Menus should be positioned relative to the edge of the screen or browser. They typically appear next to (or in front of) the element that generates them. If they are in a position to be cut off by the browser or screen’s edge, the menu can instead appear to the left, right, or above the element that generates it.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-cV83SmI1eDdsMGs%2Fcascading-menu-2.png" alt="Menus can change their position to avoid being truncated by the screen or browser’s edge."></div>

## Anatomy&#x20;

Menus display lists of related options (which can be grouped together) as well as unrelated options. Menus appear when a user taps an interactive UI element such as an icon, button, action, or content, such as selected items or text.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-aWUwOFdLMC1HR2c%2Felements-text-only.png" alt=""></div>

**Text list**

1. Container
2. Text
3. Divider

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-djl1TUpiNDI4ODQ%2Felements-text-icons.png" alt=""></div>

**Text and icon list**

1. Container
2. Leading icon
3. Text
4. Divider

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-LXcteXBoTUdlbUE%2Felements-text-icon-command.png" alt=""></div>

**Text, icon, and keyboard command list**

1. Container
2. Leading icon
3. Text
4. Divider
5. Command
6. Cascading menu indicator

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-dEtrb3B2WjlxNlk%2Felements-text-states.png" alt=""></div>

**Text with selection state list**

1. Selection state

### Actions

#### Disabled actions

Display actions as disabled when they can only be used sometimes, under certain conditions. They should be displayed as disabled rather than removing them.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-SURUSWpwRUpuN1k%2Fdisabled-text-copy.png" alt="The Redo action is disabled when that action isn’t available, and the Cut and Copy actions are disabled until content is selected."></div>

## Behavior&#x20;

### Scrolling

If not all menu items are displayed at once, menus can be scrollable. In this state, menus show a persistent scrollbar.

<div align="left"><img src="https://4132241749-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx-rODU78wKXcWFO5Gt%2F-Lx5bgSLmNJj5rubmuUl%2F-Lx5dpgQhvelqUIxWMTO%2Fimage.png?alt=media&#x26;token=a9378162-4b27-4397-9ff1-1927f336023a" alt="When its content is scrollable, menus display scrollbars."></div>

### Motion

Menus open using a scale animation (an animation that shows an element grow in size). The animation creates a relationship between the menu and the action that generates the menu.

#### Position

A menu’s position on screen affects where and how it will appear. If opened at the top of the screen, it will expand downwards (to avoid being cropped).

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B8wSqcLwbhFuSGtLYzhXYWpRdk0%2Fbehavior-menu-multiple-position.mp4>" %}
Menus at different positions on screen open in different ways, adapting to the space available.
{% endembed %}

By default, menus open with an entrance animation. However, on desktop, menus can skip the animation and open instantly instead.

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B8wSqcLwbhFuVDItMFdxZU9WNGM%2Fbaseline-motion-comparison-frame.mp4>" %}
1\. Mobile menus have entrance animations.  2. Desktop menus have the option to open instantly
{% endembed %}

## Dropdown menu&#x20;

### Usage

A dropdown menu is a compact way of displaying multiple choices. It appears upon interaction with an element (such as an icon or button) or when users perform a specific action.

### Placement

Dropdown menus are positioned relative to both the element that generates them and the edges of the screen or browser. They can appear in front of, beside, above, or below the element that generates them.

#### Default placement

A dropdown menu is typically positioned below the element that generates it.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-a2JhNkN6RVQxaEU%2Fbaseline-menu-intro.png" alt="A dropdown menu triggered by an icon on mobile."></div>

#### Cascading menu (Desktop only)

Cascading menus allow users to choose from a large variety of choices, by displaying menus with multiple levels of hierarchy.

They are organized into menus of parent list items that contain child list items. Child list items appear to right or left of parent list items, depending on where there is room to expand child list items.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1mhrkJ86SLipQ23E4qoeuOg-T5WwxZt4o%2Fmenu-intro.png" alt="A parent list item can trigger a cascading menus containing child actions."></div>

#### Contextual menu

Contextual menus aren’t triggered by a consistent UI element. They appear next to where a user taps, and their actions can vary based on the tap target.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1gd9u8DyXLip1oURXFEro2Faiz1H7FapU%2Fdropdown-contextual.png" alt="To reveal a contextual menu, tap and hold, or right click (desktop), selected text."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-NG10N1FXc25UeGM%2Fbehavior-text-selection.png" alt="A contextual menu appears next to selected text."></div>

###

### Behavior

When an option is chosen from a dropdown menu, the element that generates it remains the same.

![1. Tapping the icon triggers a dropdown menu    2. Choosing a menu option doesn’t change the icon of the element generating the menu.](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F0B54x0KDcs5U-NC1tYmRKQWIzdDA%2Fbehavior-icon.png)

## Exposed dropdown menu&#x20;

### Usage

Exposed dropdown menus display the currently selected menu item above the menu.

They can be used only when a single menu item can be chosen at a time.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1jZJMO39zb6ZxoDREog5GqOFbJBjpzp9k%2Fexposed-line-item-intro.png" alt="This exposed dropdown menu displays the currently selected item (in this case, a font selection) above the menu."></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1rL2xG7X_c0Hd81tlCPpo0puWwT68z_Nt%2Fselect-intro.png" alt="On desktop, a filled exposed dropdown menu displays the currently selected item (in this case, a type of phone) above the menu."></div>

### Behavior

Upon selecting an item, an exposed dropdown menu updates to display that item. In some cases, it can accept and display user input (whether or not it’s listed as a menu choice).

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1RABVLpsjAjSPIarQDmDYMnN1tH6zs8-b%2Fselect-behavior-filled.png)

Filled exposed dropdown menu states

1\. Inactive\
2\. Activated\
3\. Inactive and populated

![](https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1nKIXQ03XlW3r1XhvrX2saBJaU6xI5oME%2Fselect-behavior-outlined.png)

Outlined exposed dropdown menu states

1\. Inactive\
2\. Activated\
3\. Inactive and populated

### Placement

An exposed dropdown menu is positioned below the element that generates the dropdown. Alternatively the filled and outlined variations can open a native picker.

{% embed url="<https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F17qZj5btuPBbmYJJA5E7K9QOaAXg5Afbt%2Fselect-menu-behavior.mp4>" %}
The menu appears below the text field on desktop and mobile. On mobile, a native picker can instead be used.
{% endembed %}

### Variation

An exposed dropdown menu can be customized to have a different appearance or behavior.

#### Editable dropdown menu

An editable dropdown menu displays the currently selected menu item above the menu. A user can enter a value that’s not listed in the menu. You can restrict the types of values that users can enter to certain types. For example, you can set the menu to only accept positive numbers.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1Tm9leB3kjm2bhhAVmtRnGTBE_Z4fEkuP%2Feditable-dropdown-intro.png" alt="This editable dropdown menu displays the currently selected font size. A user can also enter a value not listed in the menu, such as seven."></div>

#### Filled dropdown menu

A filled dropdown menu looks like a filled text field. It displays the currently selected menu item above the menu.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1w6p664vHi-DOc3Ul5NYeDT1pmE9w8h4Y%2Fselect-type-filled.png" alt="Filled dropdown menu"></div>

The menu container corners furthest from the menu control have a 4dp radius.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1eRL5QWFjsLRcO0uTiDkcGA0UW3bVaa2w%2Fselect-type-filled-menu-style.png" alt="Filled dropdown menu    Top corners: 0dp radius    Bottom corners (shaped): 4dp radius"></div>

When using a leading icon with a filled dropdown menu, the floating label and the menu items must be aligned with one another.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1EDGPDh9kaWfnm_ydOWRCbYv3sMchFpfF%2Fselect-leading-icon-filled.png" alt="Filled dropdown menu with a leading icon"></div>

#### Outlined dropdown menu

An outlined dropdown menu looks like an outlined text field. It displays the currently selected menu item above the menu.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1c5N4e5LSayeww8gtcJvPGrQx4Veyn5Yy%2Fselect-type-outlined.png" alt="Outlined dropdown menu"></div>

For outlined dropdown menus, all corners of the menu container have a 4dp radius.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1BpXvplunzHzEEEN20UiVmJQYzq0Qmuah%2Fselect-type-outlined-menu-style.png" alt="Outlined dropdown menu    All corners: 4dp radius"></div>

Forms with outlined dropdown menus should align the menu label with the icon.

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1t23_fpUnRs7Ea5_f5I0-HSwPDxrQR5wc%2Fselect-leading-icon-outlined.png" alt="Outlined dropdown menu with a leading icon"></div>

### States

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F15FKXcRxcJWxj9VtmFrQe4erb2t5Q5Mcu%2Fselect-states-filled.png" alt="Filled exposed dropdown menu states"></div>

<div align="left"><img src="https://storage.googleapis.com/spec-host-backup/mio-components%2Fassets%2F1kES4H5C7LCWt5uqnEXZSZnO6te4-tb9j%2Fselect-states-outlined.png" alt="Outlined exposed dropdown menu states"></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://zyun.gitbook.io/temporary-views/official/material-design/original/menus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
