Button

Buttons are used for basic interactions from users. You can add event handlers to buttons to perform actions when they are clicked.

Raised

New-UDButton -Text "Button" 
New-UDButton -Text "Button" -Icon cloud -IconAlignment left
New-UDButton -Text "Button" -Icon cloud -IconAlignment right

Floating

New-UDButton -Floating -Icon plus

OnClick Event Handler

A ScriptBlock that is invoked when the button is clicked.

$MyVariable = "Some Text"
New-UDButton -Text "Click me!" -OnClick {
    Show-UDToast -Message "Clicked!"
}

Passing Variables to a Button OnClick Handler

$MyVariable = "Some Text"
New-UDButton -Text "Click me!" -OnClick (
    New-UDEndpoint -Endpoint {
        Show-UDToast -Message $ArgumentList[0]
    } -ArgumentList @($MyVariable)
)

results matching ""

    No results matching ""