MenuArgs

Type Alias MenuArgs 

Source
pub type MenuArgs = MenuProviderArgs;
Expand description

Backward compatibility alias for earlier menu args naming.

Aliased Type§

pub struct MenuArgs {
    pub placement: MenuPlacement,
    pub offset: [Dp; 2],
    pub width: DimensionValue,
    pub max_height: Option<Px>,
    pub shape: Shape,
    pub shadow: Option<ShadowProps>,
    pub container_color: Color,
    pub scrim_color: Color,
    pub close_on_background: bool,
    pub close_on_escape: bool,
    pub on_dismiss: Option<Arc<dyn Fn() + Send + Sync>>,
}

Fields§

§placement: MenuPlacement

How the menu is aligned relative to the provided anchor.

§offset: [Dp; 2]

Additional x/y offset applied after placement relative to the anchor.

§width: DimensionValue

Width behavior of the menu container. Defaults to the Material 112–280 dp range.

§max_height: Option<Px>

Maximum height of the menu before scrolling is required.

§shape: Shape

Shape of the menu container.

§shadow: Option<ShadowProps>

Optional shadow representing elevation. Defaults to a soft Material shadow.

§container_color: Color

Background color of the menu container.

§scrim_color: Color

Color of the invisible background layer. Defaults to transparent (menus do not dim content).

§close_on_background: bool

Whether a background click should dismiss the menu.

§close_on_escape: bool

Whether pressing Escape dismisses the menu.

§on_dismiss: Option<Arc<dyn Fn() + Send + Sync>>

Optional callback invoked before the menu closes (background or Escape).