There’s a couple of ways using styles, you can apply the style directly to the button using -Style or you can put the button as content of the New-UDStyle command. Here’s a couple of examples:
Of course the style hashtable can be set as a variable and used for multiple objects if that works better.
You can use ‘uppercase’, ‘lowercase’ and ‘capitalize’ as values.
For displaying a nicely integrated text button into a grid you can also set the display property from middle (default) to contents to get the “normal” left text align. You can also specify more css styling options, too.
Example from my test environment:
# Styling options for the ud buttons used in grids
$Cache:ButtonTextStyle = @{
'display' = 'contents'
'text-transform' = 'none'
'font-family' = '"Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif'
'font-size' = '15px'
'line-height' = '22.5px'
'height' = 'auto'
}
# Button in Grid
New-UDButton -Flat -Style $Cache:ButtonTextStyle -Text $_.Name -OnClick
{
Show-UDModal -Header { New-UDHeading -Size 5 -Text "Description for User '$($_.SamAccountName)'" } -Content
{
New-UDRow -Columns
{
New-UDColumn -Size 8 -Content
{
if ($_.Description)
{
$_.Description
}
else
{
"No Description"
}
}
New-UDColumn-Size 8 -Content
{
New-UDButton -Text "Close" -OnClick { Hide-UDModal }
}
}
}
}