For the complete documentation index, see llms.txt. This page is also available as Markdown.

New-UDAvatar

Creates a new Avatar.

Synopsis

Creates a new Avatar.

Syntax

New-UDAvatar [[-Id] <String>] [[-Image] <String>] [[-Alt] <String>] [[-ClassName] <String>] [[-Variant] <String>] [[-Sx] <Object>] [[-Children] <ScriptBlock>] [<CommonParameters>]

Description

Creates a new Avatar. An avatar is typically an image of a user.

Parameters

-Id

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

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

-Image

The URL of an image to show in the avatar.

-Alt

The alt text to assign to the avatar.

-ClassName

Classes to assign to the avatar component.

-Variant

The variant type of the avatar. Valid values are: "square", "rounded"

-Sx The sx property allows you to define custom CSS styles that will be applied to the component.Required? falsePosition? 6Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-ChildrenThe content to display within the avatar.Required? falsePosition? 7Default value { "A" }Accept 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-UDAvatar -Alt "Remy Sharp" -Image "/assets/logo.png"Basic avatar|Displays a basic avatar with an image.-------------------------- EXAMPLE 2 --------------------------PS >New-UDAvatar -Alt "Remy Sharp" -Content { "B" } -Variant squareSquare avatar|Displays a square avatar with an image.-------------------------- EXAMPLE 3 --------------------------PS >New-UDAvatar -Alt "Remy Sharp" -Content {PS > "A"PS > } -Sx @{PS > borderRadius = '50%'PS > }Avatar with text|Displays an avatar with text and custom CSS styles.-------------------------- EXAMPLE 4 --------------------------PS >New-UDAvatarGroup -Content {PS > 1..10 | ForEach-Object {PS > New-UDAvatar -Alt "Remy Sharp" -Content {PS > "A"PS > } -Sx @{PS > borderRadius = '50%'PS > backgroundColor = 'error.dark'PS > }PS > }PS > } -Sx @{PS > width = "20%"PS > }Avatar group|Displays a group of avatars.-------------------------- EXAMPLE 5 --------------------------PS >New-UDAvatar -Alt "Remy Sharp" -Content {PS > "A"PS > } -Sx @{PS > width = 24PS > height = 24PS > }PS > New-UDAvatar -Alt "Remy Sharp" -Content {PS > "A"PS > }PS > New-UDAvatar -Alt "Remy Sharp" -Content {PS > "A"PS > } -Sx @{PS > width = 56PS > height = 56PS > }Sizes|Displays a group of avatars with different sizes.-------------------------- EXAMPLE 6 --------------------------PS >New-UDAvatar -Alt "Remy Sharp" -Content {PS > New-UDIcon -Icon "User"PS > }Icons|Displays an avatar with an icon.-------------------------- EXAMPLE 7 --------------------------PS >New-UDAvatar -Alt "Remy Sharp" -Image "/broken.png" -Content { "A" }Fallback|Displays an avatar with a fallback to a broken image.-------------------------- EXAMPLE 8 --------------------------PS >New-UDBadge -BadgeContent {PS > 10PS > } -Children {PS > New-UDAvatarPS > }Badge| Displays an avatar with a badge.

Last updated

Was this helpful?