Skip to content

PopupMenuItem

Inherits: Control

A popup menu item.

Properties

Events

Properties#

checked class-attribute instance-attribute #

checked: bool | None = None

Whether this menu item is checked.

If set to True, a checkmark will be shown on the left of the content.

content class-attribute instance-attribute #

content: StrOrControl | None = None

A Control representing custom content of this menu item.

height class-attribute instance-attribute #

height: Number = 48.0

The minimum height of this menu item.

icon class-attribute instance-attribute #

icon: IconDataOrControl | None = None

An icon to draw before the text label of this menu item.

label_text_style class-attribute instance-attribute #

label_text_style: TextStyle | None = None

The text style of the label of this menu item.

mouse_cursor class-attribute instance-attribute #

mouse_cursor: MouseCursor | None = None

The cursor to be displayed when a mouse pointer enters or is hovering over this item.

padding class-attribute instance-attribute #

padding: PaddingValue | None = None

The padding of this menu item.

Defaults to Padding.symmetric(horizontal=12).

Note

The height value of this menu item may influence the applied padding.

For example, if a height greater than the height of the sum of the padding and a content is provided, then the padding's effect will not be visible.

Events#

on_click class-attribute instance-attribute #

on_click: ControlEventHandler[PopupMenuItem] | None = None

Called when a user clicks on this menu item.