PopupMenu[x,{val1,val2,…}]
represents a popup menu with setting x and possible values vali.
PopupMenu[Dynamic[x],{val1,…}]
takes the setting to be the dynamically updated current value of x, with the value of x being reset every time an item is selected from the menu.
PopupMenu[x,{val1lbl1,val2lbl2,…}]
represents a popup menu in which possible value vali is indicated by lbli.
PopupMenu[x,{val1lbl1,…},dlbl]
displays the menu item as dlbl if x is none of the vali.
PopupMenu[x,{…},dlbl,base]
displays as base when it is not being clicked.
PopupMenu
PopupMenu[x,{val1,val2,…}]
represents a popup menu with setting x and possible values vali.
PopupMenu[Dynamic[x],{val1,…}]
takes the setting to be the dynamically updated current value of x, with the value of x being reset every time an item is selected from the menu.
PopupMenu[x,{val1lbl1,val2lbl2,…}]
represents a popup menu in which possible value vali is indicated by lbli.
PopupMenu[x,{val1lbl1,…},dlbl]
displays the menu item as dlbl if x is none of the vali.
PopupMenu[x,{…},dlbl,base]
displays as base when it is not being clicked.
Details and Options
- PopupMenu[x,{val1,val2,…}] displays with the vali as successive entries in the menu.
- The vali and lbli can be strings, boxes, graphics or any other expressions, including dynamic expressions.
- In PopupMenu[x,list], Delimiter can appear as an element of list, specifying a horizontal delimiter in the displayed popup menu.
- The following options can be given:
-
Appearance Automatic the overall appearance of the menu BaselinePosition Automatic alignment relative to surrounding text BaseStyle {} base style specifications for the menu ContentPadding True whether to shrink the margins tightly around the contents Enabled Automatic whether the menu is enabled, or grayed out FieldSize {{1.,50.},{1.,10.}} the size of the field for menu items FrameMargins Automatic margins to leave inside the menu frame ImageMargins 0 margins around the displayed menu ImageSize All the overall image size of the displayed menu MenuStyle {} style specifications for menu items - The settings for BaseStyle are appended to the default style typically given by the "PopupMenu" style in the current stylesheet.
Examples
open all close allBasic Examples (2)
Select values from a popup menu:
PopupMenu[a, {a, b, c, d}]Connect PopupMenu to a dynamic state:
{PopupMenu[Dynamic[x], {a, b, c, d}], Dynamic[x]}Scope (7)
PopupMenu Content (4)
Use graphics as content in PopupMenu:
PopupMenu[Dynamic[x], Table[Plot[Sin[n x], {x, 0, 10}], {n, 5}]]Use any expression as a label:
{PopupMenu[Dynamic[y], Table[Plot[Sin[x ^ n], {x, 0, 2π}] -> Sin[x ^ n], {n, 5}]], Dynamic[y]}Use Null to indicate a blank label:
{PopupMenu[Dynamic[x], {a -> Null, b -> "Some text"}], Dynamic[x]}By default, a PopupMenu leaves enough space to display without ever resizing:
d = Table[Graphics[Circle[], ImageSize -> s], {s, 20, 50, 10}]{PopupMenu[Graphics[Circle[], ImageSize -> 20], d], PopupMenu[Graphics[Circle[], ImageSize -> 50], d]}With ImageSize->Automatic, PopupMenu resizes for each pane:
{PopupMenu[Graphics[Circle[], ImageSize -> 20], d, ImageSize -> Automatic], PopupMenu[Graphics[Circle[], ImageSize -> 50], d, ImageSize -> Automatic]}PopupMenu Control (3)
PopupMenu[c, {a, b, c, d}]The setting is based on value, regardless of labels:
{PopupMenu[Dynamic[x], {a, b, c}], Dynamic[x]}{PopupMenu[Dynamic[y], {a -> "one", b -> "two", c -> "three"}], Dynamic[y]}Connect a PopupMenu to a slider:
{PopupMenu[Dynamic[i], {a, b, c, d}], Slider[Dynamic[i], {{a, b, c, d}}]}Options (9)
Alignment (1)
BaselinePosition (1)
Enabled (1)
FieldSize (3)
Table[PopupMenu[a, {a, b, c, d}, FieldSize -> s], {s, {Tiny, Small, Medium, Large}}]Grid[Table[PopupMenu[a, {a, b, c, d}, FieldSize -> {w, h}], {h, {1, 2, 4}}, {w, {2, 4, 10}}]]Allow a width and height between set values:
Column[Table[PopupMenu[N[Pi, n], {N[Pi, n], 2, 3, 4}, FieldSize -> {{2, 10}, {1, 2}}], {n, {4, 15, 25, 40}}]]FrameMargins (1)
ImageMargins (1)
Applications (1)
See Also
SetterBar RadioButtonBar PopupView ActionMenu ChoiceDialog Manipulate Control InputField Setter Toggler FieldCompletionFunction
Function Repository: PopupMenuOther
Tech Notes
Text
Wolfram Research (2007), PopupMenu, Wolfram Language function, https://reference.wolfram.com/language/ref/PopupMenu.html (updated 2010).
CMS
Wolfram Language. 2007. "PopupMenu." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2010. https://reference.wolfram.com/language/ref/PopupMenu.html.
APA
Wolfram Language. (2007). PopupMenu. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PopupMenu.html
BibTeX
@misc{reference.wolfram_2026_popupmenu, author="Wolfram Research", title="{PopupMenu}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/PopupMenu.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_popupmenu, organization={Wolfram Research}, title={PopupMenu}, year={2010}, url={https://reference.wolfram.com/language/ref/PopupMenu.html}, note=[Accessed: 13-June-2026]}