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

New-UDBadge

Synopsis

Badge generates a small badge to the top-right of its child(ren).

Syntax

New-UDBadge [[-Id] <String>] [[-Color] <String>] [[-Children] <ScriptBlock>] [[-BadgeContent] <ScriptBlock>] [-Invisible] [[-Max] <Int32>] [[-Overlap] <String>] [-ShowZero] [[-Variant] <String>] [[-Location] <String>] [[-Sx] <Hashtable>] [<CommonParameters>]

Description

Badge generates a small badge to the top-right of its child(ren).

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

-Color

The color of the badge. Valid values are: "default", "primary", "secondary", "error", "info", "success", "warning"

-Children

The content that the badge is attached to.

-BadgeContent

The content to display within the badge.

-Invisible

Whether the badge is invisible.

-Max

The maximum number to display. If the number is greater than this, it will display as "99+". Default is 99.

-Overlap

The overlap of the badge. Valid values are: "circular", "rectangular"

-ShowZero

Whether to show the badge when the badgeContent is 0.

-Variant

The variant of the badge. Valid values are: "standard", "dot"

-Location

The location of the badge. Valid values are: "topright", "topleft", "bottomright", "bottomleft"

-Sx

Common parameters

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters.

Notes

General notes

[Component("Badge", "Badge", "Creates a new badge.")]

Examples

Example 1: Primary badge

Displays a badge with the text "4" on a primary button.

Example 2: Color

Changes the color of the badge.

Example 3: ShowZero

Shows the badge when the badgeContent is 0.

Example 4: Max

The maximum number to display. If the number is greater than this, it will display as "99+". Default is 99.

Example 5: Overlap

The overlap of the badge.

Example 6: Dot

Display a dot badge.

Last updated

Was this helpful?