Center items in UD-Alert?

Is there a way I can center the items in a UD-Alert?
I have custom css to center my text in a table with textalign, but this does not work for a ud alert

it currently looks like this:

I’d like the alert (review complete) to be centered as well

Passing a -ClassName and aligning to center should do the trick.

Also, if thats a table you should be able to pass New-UDTableColumn -Align 'Left' in your column cmdlet to align data in columns.

Oh I did not know about the Table Colum Align! That makes it a lot easier.

Though sorry, I’m struggling with the -ClassName. Could you give an example?

I got it by doing the following:

New-UDStyle -Style '.css-1ru7g0r-MuiPaper-root-MuiAlert-root {place-content: center;}  ' -Content {
    New-UDAlert -Text "Hello" -Severity error

Actually, no, it works for one, but it seems the 2nd part of that name is randomly generated


the 1ru7g0r is different for every element, and since I’m generating these on the fly, this won’t work.

Those are typically generated dynamically by parameter values on a New-UDSomethingSomething cmdlet.

I have not personally used New-UDAlert but a good example is if you do a New-UDStack -Direction row… that row will appear in a dynamically generated CSS class inline with where it is placed within how MaterialUI works.

Hey @gswider
Actually I had to do something similar in the past… you almost had it… :wink:
You have to just ignore the dynamic css stuff and do it like that:

New-UDStyle -Style '.MuiAlert-root {place-content: center;}  ' -Content {
        New-UDAlert -Text "Hello" -Severity error

and boom! :slight_smile:

have fun with it. :wink:

best regards,