For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-UDMenu

Synopsis

Menus display a list of choices on temporary surfaces.

Syntax

New-UDMenu [[-Id] <String>] [[-Text] <String>] [[-OnChange] <Endpoint>] [-Children] <ScriptBlock> [[-ClassName] <ParameterAttribute>] [[-Variant] <String>] [[-Icon] <Hashtable>] [[-Size] <String>] [[-Sx] <Hashtable>] [[-Style] <Hashtable>] [<CommonParameters>]

Description

Creates a pop up menu.

Parameters

-Id

The ID of this component.

Required?                    false
Position?                    1
Default value                [Guid]::NewGuid()
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false

-Text

The text to display in the button that opens this menu.

-OnChange

An event handler to call when the user selects an item from the menu. $EventData will include the selected item.

-Children

The items to display in the menu.

-ClassName

The class name of the menu.

-Variant

The button variant for the menu.

-Icon

-Size

The size of the menu button. Valid values are: "small", "medium"

-Sx

The sx prop allows you to add custom styles to the component.

-Style

The style prop allows you to add custom styles to the component.

Common parameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Outputs

Examples

Example 1: Basic menu

Creates a simple menu.

Example 2: Menu with event handler

Creates a menu with an event handler.

Example 3: Text variant

Creates a menu with a text variant.

Example 4: Small menu

Creates a small menu.

Example 5: Menu with values

Creates a menu with values.

[Component("Menu", "Bars", "Creates a new card.")]

Last updated

Was this helpful?