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

New-UDChip

Chips are compact elements that represent an input, attribute, or action.

Synopsis

Chips are compact elements that represent an input, attribute, or action.

Syntax

New-UDChip [-Id <String>] [[-Label] <String>] [[-OnDelete] <Endpoint>] [[-OnClick] <Endpoint>] [[-Icon] <Object>] [[-Style] <Hashtable>] [[-Variant] <String>] [[-Size] <String>] [-ClassName <String>] [-Color <String>] [<CommonParameters>]

    New-UDChip [-Id <String>] [[-Label] <String>] [[-OnDelete] <Endpoint>] [[-OnClick] <Endpoint>] [[-Style] <Hashtable>] [[-Variant] <String>] [[-Avatar] <String>] [[-AvatarType] <String>] [[-Size] <String>] [-ClassName <String>] [-Color <String>] [<CommonParameters>]

Description

Chips are compact elements that represent an input, attribute, or action.

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

-Label

The label for the chip.

-OnDelete

A script block to call when the chip is deleted.

-OnClick

A script block to call when the chip is clicked.

-Icon An icon to show within the chip.Required? falsePosition? 2Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-StyleCSS styles to apply to the chip.Required? falsePosition? 3Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-VariantThe theme variant to apply to the chip.Required? falsePosition? 4Default value defaultAccept pipeline input? falseAliasesAccept wildcard characters? false-AvatarAn avatar to show within the chip.Required? falsePosition? 5Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-AvatarTypeThe type of avatar to show in the chip.Required? falsePosition? 6Default valueAccept pipeline input? falseAliasesAccept wildcard characters? false-SizeThe size of the chip. Valid values are: "small", "medium"Required? falsePosition? 10Default value mediumAccept pipeline input? falseAliasesAccept wildcard characters? false-ClassNameA CSS class to apply to the chip.Required? falsePosition? namedDefault valueAccept pipeline input? falseAliasesAccept wildcard characters? false-ColorThe color of the chip. Defaults to 'default'. Valid values: "default", "primary", "secondary"Required? falsePosition? namedDefault value defaultAccept 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-UDChip -Label 'Basic' -Icon (New-UDIcon -Icon 'user') -Id 'chip1'Basic chip|A basic chip with an icon.-------------------------- EXAMPLE 2 --------------------------PS >New-UDChip -Variant outlined -Label 'Outlined' -Icon (New-UDIcon -Icon 'user') -Id 'chip2'Outlined chip|An outlined chip with an icon.-------------------------- EXAMPLE 3 --------------------------PS >New-UDChip -Label 'Clickable' -Icon (New-UDIcon -Icon 'user') -OnClick {PS > Show-UDToast -Message 'Hello!'PS > } -Id 'chip3'Clickable chip|A clickable chip with an icon.-------------------------- EXAMPLE 4 --------------------------PS >New-UDChip -Label 'Deletable' -Icon (New-UDIcon -Icon 'user') -OnDelete {PS > Show-UDToast -Message 'Deleted!'PS > } -Id 'chip4'Deletable chip|A deletable chip with an icon.-------------------------- EXAMPLE 5 --------------------------PS >New-UDChip -Label 'Clickable and deletable' -Icon (New-UDIcon -Icon 'user') -OnClick {PS > Show-UDToast -Message 'Hello!'PS > } -OnDelete {PS > Show-UDToast -Message 'Deleted!'PS > } -Id 'chip5'Clickable and deletable chip|A clickable and deletable chip with an icon.-------------------------- EXAMPLE 6 --------------------------PS >New-UDChip -Avatar "A" -AvatarType letter -Label 'Avatar' -Id 'chip6'Avatar chip|A chip with an avatar.-------------------------- EXAMPLE 7 --------------------------PS >New-UDChip -Avatar "https://picsum.photos/200/300" -AvatarType image -Label 'Avatar' -Id 'chip7'Image chip|A chip with an avatar image.-------------------------- EXAMPLE 8 --------------------------PS >New-UDChip -Label 'Small' -Icon (New-UDIcon -Icon 'user') -Size small -Id 'chip8'Small chip|A small chip with an icon.-------------------------- EXAMPLE 9 --------------------------PS >New-UDChip -Style @{background = 'red'; color = 'white'} -Label 'Styled' -Icon (New-UDIcon -Icon 'user') -Id 'chip9'

Last updated

Was this helpful?