Log-in required.

You are trying to access the internal Editor Foundations design system.
Sign-in with your Unity Google account to continue, or visit the public site.

Implementation references

An overview of implementation references.

Scripting API
ContextualMenuManipulator
Manipulator that displays a contextual menu.

Menus · UX essentials

Best practices to provide access points to contextual actions, items, or windows.

When to disable controls or hide them altogether
Blue plus sign icon indicating that clicking on this will expand this content
Provide access points to your feature in predictable locations.
Blue plus sign icon indicating that clicking on this will expand this content
Avoid having more than 2 levels of submenus.
Blue plus sign icon indicating that clicking on this will expand this content
Use divider in context menus to group actions
Blue plus sign icon indicating that clicking on this will expand this content
Action-oriented menu and button labels use verbs
US-0212
Blue plus sign icon indicating that clicking on this will expand this content
Context menu actions are accessible via other access points
Blue plus sign icon indicating that clicking on this will expand this content
Use ellipses ("...") in labels if the action requires additional input
Blue plus sign icon indicating that clicking on this will expand this content
Window titles should match action labels that initiate them
Blue plus sign icon indicating that clicking on this will expand this content

Resources and API documentation

Overview

From left to right, the application menu, Scene anchored context menu, and a right-click context menu on a Game Object.

Menus provide access points to actions, items, or windows to help a user execute a function. All menus are displayed on a temporary window that draws on top of the editor surface, such as a right click menu or a drop down.

Index

3 menu types; application menu, right-click context menu and anchored context menu

Menu types found in the editor:

Content Guidance

Organization

Do recommendation illustrated by a green checkbox icon

Do sort items by priority

Leverage user research and feedback to identify the most used actions for that context, and prioritize those actions from the top down.

Do recommendation illustrated by a green checkbox icon

Do always allow access to submenu items

If the context makes an item open a submenu in a disabled state, the user should still be able to open that submenu and read the options. All options should display as disabled in this case.

Don't recommendation illustrated by a red X icon

Do not use lengthy menus

Try to reduce the number of options available per menu to ease user navigation. If a menu contains too many items, consider adding your actions to a new submenu or a new menu heading. Exceptions to this rule are menus that display user-generated items or actions, which have no cap on length.

Do recommendation illustrated by a green checkbox icon

Do group related items together

Actions that are closely related should be grouped together, and menus should use a horizontal separator to split the groups. For example, Cut, Copy, and Paste are related actions, and would be separate from any selection state actions.

Cursor changing format while moving
Group related items together

Additionally, if an item fits a group but is used less often, put that item at the bottom of the group even if it sits above other more-used items that are not part of that group. For example, Paste and Paste without Formatting would both sit above Delete, even though users are more likely to use Delete than Paste without Formatting.

Cursor changing format while moving
Group related items together regardless of priority

Repeated label prefixes:

Do recommendation illustrated by a green checkbox icon
Group menu items with their prefix.
Don't recommendation illustrated by a red X icon
Avoid having multiple menu items that start with the same prefix.

Label and Item Names

Labels should communicate actions or states

Ensure that your label succinctly and clearly communicates the intended action or state.

Use verbs or verb phrases

Action item labels should use verbs or verb phrases such as Cut, Copy, and Share File.

Clearly communicate state changes

Items that change a state should clearly communicate the outcome of selecting that item such as Show Object, and Hide Object.

Use condensed language and title-case capitalization

To condense English language labels avoid using articles such as "a", "an", and "the."
When a label uses more than one word, use title casing for capitalization.

Indicate further action with ellipses

If an item in a menu will trigger follow-up actions or user input in any way, append an ellipsis (...) to the item label to indicate that the user will be taken to the next window or action item.

Cursor changing format while moving
"Paste Special" action will trigger a follow-up window
Disable or dim unavailable items

Items that are present in the menu but not available in the current context should never be hidden or removed. Always use the disabled text state for items that cannot be selected. If all items in a menu are not applicable to the context, display all items in the menu as disabled so the user can still view and read the menu.

Cursor changing format while moving
Secondary "Paste" action is disabled
Labels should not use indenting

Items in the menus should not be indented. Consider using a group separator or sub menu to indicate grouping or hierarchy in menu items.

Selection States

When to use a checkmark toggle

States that are persistent should use a checkmark to indicate if the item is active or not active. For example, for text that is Bold, the Bold menu item will display checked, while text that is Italicized will display the Bold menu item unchecked.

When to redraw the same item row

A state that is mutually exclusive can use the same item row. Changing the state of the row will also change the label being displayed, in order to keep the menu shorter and easier to parse. For example, if the item Show Object is selected, upon the next open for the menu the item will be replaced with Hide Object.

When to draw multiple item rows

Use paired item rows for a toggled state only when clarity is added. Sometimes users will benefit from seeing both states of a binary toggle at the same time. If clarity is added by displaying both states, the currently selected state should display as a disabled action since the user cannot select the same state again.

When to use a radio button

Mutually exclusive states with three or more options should use radio buttons. If a state is mutually exclusive but has more than two options, all items should be listed in a group. The currently selected state should have a radio button indicator.

Interaction Guidance

Mouse Interactions

Hovering
  1. Hovering in the window will highlight the item under the cursor
  2. Highlights should appear immediately
  3. If the item has a sub menu available, hovering over the item will spawn the sub menu
  4. Sub menus should open after a 0.3 second delay with the cursor in bounds of the item row
Left Mouse Button Click
  1. Left clicking on an item will select the item under the cursor and close the menu pop up
  2. Left clicking beyond the menu bounds will close the menu and take no actions
Right Mouse Button Click
  1. Right click has no action inside of the menu pop up
Hover Delay
  1. To open a sub menu from an item row, the user can either click the item row or hover over the item row
  2. Menus will pop up after a hover period of 0.3 seconds; this allows the user to navigate the menu with minimal invasive pop ups and will keep a window open while the user navigates to a sub menu item

Keyboard Interactions

Arrow Navigation
  1. moves the selection item down; once at the bottom of the list, the selection highlight will loop back to the top of the menu
  2. moves the selection item up; once at the top of the list, the selection highlight will loop back to the top of the menu
  3. will open a submenu and move the selection highlight to the first item on the submenu; if the item row does not have a submenu, the right arrow action is null
  4. will close a submenu and move the selection highlight to the item row that opened the menu; on the primary menu window, the left arrow action is null
Selection and Escaping
  1. The Enter key selects the item row that is currently highlighted; if the item row has an action, the menu will close and the action will run. If the item row opens a submenu, the sub menu window will open and the first item will highlight
  2. The Esc key will close all open menu or sub menus and perform no actions
Alphanumeric Navigation
  1. Pressing an alphabetical key will highlight the first item row with a label that starts with a matching letter
  2. Pressing the same letter key more than once will cycle through available item rows with matching letters, allowing navigation between items with the same letter
  3. Alphanumeric keys should have no interactions with shortcuts while a menu window is focused

Window Positioning

Default
Cursor changing format while moving
Menu items with visible cursor, displaying relative location of the window to the mouse
  1. When invoked from a button or label item, the menu should appear directly underneath the item that invoked it
  2. When invoked from a mouse click, the menu should appear underneath and to the right of the mouse click location
  3. When opening a sub menu, the menu will open to the right and the top item of the submenu will align with the item row that spawned it
Horizontal Alternate
Cursor changing format while moving
Menu items with visible cursor, displaying relative location of the window to the mouse
  1. This alternate positioning is used when there is not enough space in the window for the menu to spawn to the right
  2. When invoked from a button or label item, the menu should appear directly underneath the item that invoked it, snapping the right edge to the button bounds
  3. When invoked from a mouse click, the menu should appear underneath and to the left of the mouse click location
  4. When opening a sub menu, the menu will open to the left of the primary window and follow vertical rules
Vertical Alternate
Cursor changing format while moving
Menu items with visible cursor, displaying relative location of the window to the mouse
  1. This alternate positioning is used when there is not enough space in the window for the menu to spawn underneath the click
  2. When invoked from a button or label item, the menu should appear directly above the item that invoked it
  3. When invoked from a mouse click, the menu should snap the bottom bounds of the pop up to the bottom of the application window that spawned it
  4. When opening a sub menu, the menu will follow horizontal rules and align the last item to the item row that spawned it
Item Row Interactions
Cursor changing format while moving
Menu items, one row displaying the hover state for items

When hovered or selected, the item row background will use the highlight color to indicate the potential selection.

Cursor changing format while moving
Menu items, one row displaying a latent selection state

When hovered or selected, an item row that opened a submenu should use a latent selection state.

Anatomy

Parts of a menu.

Menu windows are composed of

1 Window Frame
2 Header Row (can contain a label, quick access buttons, or a search bar)
3 Item Rows

Window Frame

  1. The containing window that holds the menu content
  2. Margins and padding are 6 px on all edges
Style variables
--unity-colors-app_toolbar-background
The background color for the main toolbar
#8A8A8A
#191919
--unity-colors-highlight-background-inactive
The background color for selected items or selected text when the control does not have focus
#AEAEAE
#4D4D4D

Header Rows

  1. Row at the top of the menu window that displays a short header for the context the menu has been invoked from.
  2. Use the standard font size 12 px for text.
Style variables
--unity-colors-window-text
The text color for a window
#090909
#BDBDBD
Quick access buttons (optional)
  1. When a context menu is used and there are quick, frequent actions, quick access buttons can be used to speed user interactions
  2. Quick access buttons should use the default button group styling from the UI Toolkit

Item Rows

Every item in a menu uses an item row to display content and select actions.

Active State
Cursor changing format while moving
Active item row
  1. Label is standard
  2. Icons are colored
Inactive State
Cursor changing format while moving
Inactive item row
  1. Label is dimmed
  2. Icon is greyscale and dimmed
  3. Any indicator is also dimmed