> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/powershell-commands/new-udcard.md).

# New-UDCard

### Synopsis

Creates a new card.

### Syntax

```powershell
New-UDCard [-Id <String>] [-ClassName <String>] [-Style <Hashtable>] [-Elevation <Int32>] [-Title <String>] [-TitleAlignment <String>] [-Image <String>] [-Text <String>] [-Raised] [-Sx <Object>] [-Variant <String>] [-OnClick <Endpoint>] [-RemoveMargin] [<CommonParameters>]

    New-UDCard [-Id <String>] [-ClassName <String>] [-Header <Object>] [-Body <Object>] [-Expand <Object>] [-Footer <Object>] [-Media <Object>] [-Style <Hashtable>] [-Elevation <Int32>] [-Raised] [-Sx <Object>] [-Variant <String>] [-OnClick <Endpoint>] [-RemoveMargin] [<CommonParameters>]

    New-UDCard [-Id <String>] [-ClassName <String>] [-Style <Hashtable>] [-Elevation <Int32>] [-Title <String>] [-TitleAlignment <String>] [-Content <ScriptBlock>] [-Image <String>] [-Raised] [-Avatar <Object>] [-Sx <Object>] [-Variant <String>] [-OnClick <Endpoint>] [-RemoveMargin] [<CommonParameters>]
```

### Description

Creates a new card. Cards are used to display related content.

### Parameters

#### -Id

The ID of the component. It defaults to a random GUID.

```
Required?                    false
Position?                    named
Default value                ([Guid]::NewGuid()).ToString()
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -ClassName

A CSS class to assign to this card.

```
Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Aliases
Accept wildcard characters?  false
```

#### -Header The header for this card. The header typically contains a title for the card. Use New-UDCardHeader to create a header.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-Body The body for this card. This is the main content for the card. Use New-UDCardHeader to create a body.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-Expand Th expand content for this card. Expand content is show when the user clicks the expansion button. Use New-UDCardExpand to create an expand.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-Footer The footer for this card. Footer contents typically contain actions that are relavent to the card. Use New-UDCardFooter to create a footer.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-Media Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-StyleStyles to apply to the card.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-ElevationThe amount of elevation to provide the card. The more elevation, the more it will appear the card is floating off the page.Required?                    falsePosition?                    namedDefault value                0Accept pipeline input?       falseAliasesAccept wildcard characters?  false-TitleA title for the card.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-TitleAlignmentThe alignment for the title.Required?                    falsePosition?                    namedDefault value                leftAccept pipeline input?       falseAliasesAccept wildcard characters?  false-ContentThe content of the card.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-ImageAn image to show in the card.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-TextRequired?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -Raised \[\<SwitchParameter>]Required?                    falsePosition?                    namedDefault value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false-Avatar Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-Sx Theme-based style to apply to the card.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false-VariantRequired?                    falsePosition?                    namedDefault value                elevationAccept pipeline input?       falseAliasesAccept wildcard characters?  false-OnClickThe action to take when the card is clicked.Required?                    falsePosition?                    namedDefault valueAccept pipeline input?       falseAliasesAccept wildcard characters?  false    -RemoveMargin \[\<SwitchParameter>]Required?                    falsePosition?                    namedDefault value                FalseAccept pipeline input?       falseAliasesAccept wildcard characters?  false    \<CommonParameters>        This cmdlet supports the common parameters: Verbose, Debug,        ErrorAction, ErrorVariable, WarningAction, WarningVariable,        OutBuffer, PipelineVariable, and OutVariable. For more information, see        about\_CommonParameters (<https://go.microsoft.com/fwlink/?LinkID=113216).Outputs--------------------------> EXAMPLE 1 --------------------------PS >New-UDCard -Title 'My Card' -Text 'This is my card' -Id 'card1'Basic card|A basic card with a title and text.-------------------------- EXAMPLE 2 --------------------------PS >New-UDCard -Title 'My Card' -Text 'This is my card' -Id 'card2' -Image '<https://picsum.photos/200/300>' -Style @{ width = '200px' }Card with image|A card with an image.-------------------------- EXAMPLE 3 --------------------------PS >New-UDCard -Title 'My Card' -Text 'This is my card' -Id 'card3' -Elevation 10Card with elevation|A card with a higher elevation.-------------------------- EXAMPLE 4 --------------------------PS >New-UDCard -Title 'My Card' -Text 'This is my card' -Id 'card4' -TitleAlignment centerTitle Alignment|A card with a centered title.-------------------------- EXAMPLE 5 --------------------------PS >New-UDCard -Text 'This is my card' -OnClick {PS >     Show-UDToast -Message 'You clicked the card'PS > } -Id 'card5'OnClick|A card with an OnClick event handler.-------------------------- EXAMPLE 6 --------------------------PS >$Header = New-UDCardHeader -Avatar (New-UDAvatar -Content { "R" } -Sx @{ backgroundColor = "#f44336" }) -Action (New-UDIconButton -Icon (New-UDIcon -Icon 'EllipsisVertical')) -Title 'Shrimp and Chorizo Paella' -SubHeader 'September 14, 2016';PS >     $Media = New-UDCardMedia -Image '<https://mui.com/static/images/cards/paella.jpg'PS> >     $Body = New-UDCardBody -Content {PS >         New-UDTypography -Text ' This impressive paella is a perfect party dish and a fun meal to cook together with your guests. Add 1 cup of frozen peas along with the mussels, if you like.' -Sx @{PS >             color = 'text.secondary'PS >         } -Variant body2PS >     }PS >     $Footer = New-UDCardFooter -Content {PS >         New-UDIconButton -Icon (New-UDIcon -Icon 'Heart')PS >         New-UDIconButton -Icon (New-UDIcon -Icon 'ShareAlt')PS >     }PS >     $Expand = New-UDCardExpand -Content {PS >         $Description = "Heat oil in a (14- to 16-inch) paella pan or a large, deep skillet over medium-high heat. Add chicken, shrimp and chorizo, and cook, stirring occasionally until lightly browned, 6 to 8 minutes. Transfer shrimp to a large plate and set aside, leaving chicken and chorizo in the pan. Add pimentón, bay leaves, garlic, tomatoes, onion, salt and pepper, and cook, stirring often until thickened and fragrant, about 10 minutes. Add saffron broth and remaining 4 1/2 cups chicken broth; bring to a boil."PS >         New-UDTypography -Text $DescriptionPS >     }PS >     New-UDCard -Header $Header -Media $Media -Body $Body -Footer $Footer -Expand $Expand -Sx @{PS >         maxWidth = 345PS >         border   = '2px solid #f0f2f5'PS >     } -Id 'card5'Complex Card|A card with all the features.-------------------------- EXAMPLE 7 --------------------------PS >$Expand = New-UDCardExpand -Content { "$(Get-Random)" } -DynamicPS > New-UDCard -Expand $Expand -Id 'card6'Dynamic Expand|A card with a dynamic expandable content. The content will be updated every time the card is expanded.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/powershell-commands/new-udcard.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
