New-UDSideNav Collapsable

Does anyone know if you can make a custom side nav collapsable? From what I have seen and looked at on the docs, you can have the default generated one (which is collapsable), use -none which removes it entirely, or use a custom side nav which has it always there.

Am i missing something or…?

The navbar I posted here is custom and collapsible.

You should be able to salvage from that maybe? Though note that it uses a -endpoint and not -content.

I did see that, but i couldn’t see how in there you made it collapsible with the Hamburger menu like you can with the default one?

Well,I didn’t do anything.
That’s the default behavior.

Can you share the navbar code?

Edit: Of course, right after i post it… i find the problem…

insert expletives here

1 Like

How about removing that -Fixed parameter? :slight_smile:

Good work!

I guess I was your rubber duck :stuck_out_tongue:

2 Likes
$Page2 = New-UDPage -Name "Page Name 2" -Content { New-UDCard -Id 'page-2'}

$Navigation = New-UDSideNav -Content {
    New-UDSideNavItem -Text "My First Page" -PageName "Page Name" -Icon group
    New-UDSideNavItem -Text "My Second Page" -PageName "Page Name 2" -Icon User
    New-UDSideNavItem -Text "Google" -Url 'https://www.google.com' -Icon Users
}

$DB1 = New-UDDashboard -Title "Navigation" -Pages @($Page1, $Page2) -Navigation $Navigation

Start-UDDashboard -Name "Nav1" -Dashboard $DB1 -Port 10063```

Adam posted this example that I've been testing with.