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

New-UDRadioGroup

Synopsis

Creates a group of radio buttons.

Syntax

New-UDRadioGroup [[-Id] <String>] [[-Label] <String>] [[-Children] <ScriptBlock>] [[-OnChange] <Endpoint>] [[-Value] <String>] [[-ClassName] <String>] [[-DefaultValue] <String>] [-Disabled] [[-Sx] <Hashtable>] [[-Style] <Hashtable>] [[-Aria] <ScriptBlock>] [<CommonParameters>]

Description

Creates a group of radio buttons. Within a group, only a single radio will be able to be selected.

Parameters

-Id

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

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

-Label

The label to show for this radio group.

-Children

The radio buttons to include within this group.

-OnChange

A script block to call when the radio group selection changes. The $EventData variable will include the value of the radio that is selected.

-Value

The selected value for this radio group.

-ClassName

A CSS class to apply to the radio group.

-DefaultValue

The default value for this radio group.

-Disabled

Whether the radio group is disabled.

-Sx

The sx prop allows you to add custom styles to your component.

-Style

The style prop allows you to add custom styles to your component.

-Aria

A script block of New-UDAriaAttribute calls that supplies ARIA or role attributes for the radio group.

Common parameters

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

Outputs

Examples

Example 1: Basic radio group

Creates a basic radio group with three radio buttons.

Example 2: OnChange

Creates a basic radio group with three radio buttons and an OnChange script block.

Example 3: Disabled

Creates a basic radio group with three radio buttons and disables the group.

Example 4: Default Value

Creates a basic radio group with three radio buttons and sets the default value to 'Sarah'.

Example 5: Label Placement

Creates a basic radio group with three radio buttons and sets the label placement to 'start'.

Last updated

Was this helpful?