Card with "On-click"--like functionality

Hi, I’m trying to create a Card that users click on and navigate to x or y, just like New-UdButton -OnClick or -Href.

I followed these and keep bumping into errors, does anybody have a working sample? Thanks!

Tried:
How to create a simple, clickable card with an onClick event - Universal Dashboard / Cookbook - Ironman Software Forums

How to make a card a link? - Universal Dashboard / Universal Dashboard Help - Ironman Software Forums

Slight Enhancement: New-UDCard Horizontal Image - Universal Dashboard / Cookbook - Ironman Software Forums

This works for me.

    New-UDElement -tag div -Attributes @{
        style = @{
            cursor = "pointer"
        }
        onClick = {
            Invoke-UDRedirect "https://ironmansoftware.com"
        }
    } -Content {
        New-UDCard -Title 'Click Me' -Content {
            "Yes"
        }
    }
2 Likes

That worked like a charm. Thanks Adam! You’re a legend.

1 Like