Modal
Modal component for Universal Dashboard.
Modals inform users about a task and can contain critical information, require decisions, or involve multiple tasks.

Basic

1
New-UDButton -Text 'Basic' -OnClick {
2
Show-UDModal -Content {
3
New-UDTypography -Text "Hello"
4
}
5
}
Copied!

Full Screen

1
New-UDButton -Text 'Full Screen' -OnClick {
2
Show-UDModal -Content {
3
New-UDTypography -Text "Hello"
4
} -Footer {
5
New-UDButton -Text "Close" -OnClick { Hide-UDModal }
6
} -FullScreen
7
}
Copied!

Full Width

Full width modals take up the full width as defined by the -MaxWidth parameter.
1
New-UDButton -Text 'Full Width' -OnClick {
2
Show-UDModal -Content {
3
New-UDTypography -Text "Hello"
4
} -FullWidth -MaxWidth 'md'
5
}
Copied!

Persistent

Persistent modals do not close when you click off of them. You will have to close it with Hide-UDModal.
1
New-UDButton -Text 'Persistent' -OnClick {
2
Show-UDModal -Content {
3
New-UDTypography -Text "Hello"
4
} -Footer {
5
New-UDButton -Text "Close" -OnClick { Hide-UDModal }
6
} -Persistent
7
}
Copied!

Hide a Modal

You can use the Hide-UDModal button to hide a modal that is currently show.
1
New-UDButton -Text 'Basic' -OnClick {
2
Show-UDModal -Content {
3
New-UDTypography -Text "Hello"
4
}
5
Start-Sleep 5
6
Hide-UDModal
7
}
Copied!

API

Last modified 5mo ago