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

New-UDTextbox

Synopsis

Textboxes let users enter and edit text.

Syntax

New-UDTextbox [[-Id] <String>] [[-Label] <String>] [[-Placeholder] <String>] [[-Value] <String>] [[-Type] <String>] [-Disabled] [[-Icon] <Object>] [-Autofocus] [-Multiline] [[-Rows] <Int32>] [[-RowsMax] <Int32>] [-FullWidth] [[-Variant] <String>] [[-ClassName] <String>] [[-OnEnter] <Endpoint>] [[-OnBlur] <Endpoint>] [-Shrink] [[-OnValidate] <Endpoint>] [[-HelperText] <String>] [[-OnChange] <Endpoint>] [[-Minimum] <Int32>] [[-Maximum] <Int32>] [[-MaximumLength] <Int32>] [[-Sx] <Hashtable>] [[-Style] <Hashtable>] [[-MaskPattern] <String>] [[-Attributes] <Hashtable>] [[-Aria] <ScriptBlock>] [<CommonParameters>]

Description

Creates a textbox. Textboxes can be used by themselves or within a New-UDForm.

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

A label to show above this textbox.

-Placeholder

A placeholder to place within the text box.

-Value

The current value of the textbox.

-Type

The type of textbox. This can be values such as text, password or email.

-Disabled

Whether this textbox is disabled.

-Icon

The icon to show next to the textbox. Use New-UDIcon to create an icon.

-Autofocus

Whether to autofocus this textbox.

-Multiline

Creates a multiline textbox

-Rows

The number of rows in a multiline textbox.

-RowsMax

The maximum number of rows in a multiline textbox.

-FullWidth

Whether to make this textbox take up the full width of the parent control.

-Variant

The variant of textbox. Valid values are "filled", "outlined", "standard"

-ClassName

A CSS class to apply to the textbox.

-OnEnter

A script block that is called when the user presses the enter key. The $EventData variable will contain the current value of the textbox.

-OnBlur

A script block that is called when the user leaves the textbox. The $EventData variable will contain the current value of the textbox.

-Shrink

Whether to shrink label by default.

-OnValidate

A script block that is called when the user leaves the textbox. The $EventData variable will contain the current value of the textbox. If the script block returns an validation result that is invalid, it will be displayed below the textbox.

-HelperText

A helper text to show below the textbox.

-OnChange

A script block that is called when the user changes the value of the textbox. The $EventData variable will contain the current value of the textbox.

-Minimum

The minimum value for a number textbox.

-Maximum

The maximum value for a number textbox.

-MaximumLength

The maximum length of the text in the textbox.

-Sx

A hashtable of theme-based properties to apply to the textbox.

-Style

A hashtable of CSS properties to apply to the textbox.

-MaskPattern

A mask pattern to apply to the textbox. This is used for input masks. Check iMaskjs for more information.

-Attributes

-Aria

A script block of New-UDAriaAttribute calls that supplies ARIA or role attributes for the textbox. For example, -Aria { New-UDAriaAttribute -Label -Value 'Search query' } assigns an accessible label.

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 textbox

Creates a basic textbox.

Example 2: Password textbox

Creates a password textbox.

Example 3: Email textbox

Creates an email textbox.

Example 4: Disabled textbox

Creates a disabled textbox.

Example 5: Textbox with icon

Creates a textbox with an icon.

Example 6: Autofocus textbox

Creates a textbox that will autofocus when the page loads.

Example 7: Multiline textbox

Creates a multiline textbox.

Example 8: Multiline textbox with 5 rows

Creates a multiline textbox with 5 rows.

Example 9: Variant

Creates a filled textbox.

Example 10: OnEnter

Creates a textbox with an OnEnter event.

Example 11: OnBlur

Creates a textbox with an OnBlur event.

Example 12: OnValidate

Creates a textbox with an OnValidate event.

Example 13: Helper Text

Creates a textbox with helper text.

Example 14: OnChange

Creates a textbox with an OnChange event.

Example 15: Minimum and Maximum

Creates a number textbox with a minimum and maximum value.

Example 16: Mask Pattern

Creates a textbox with a mask pattern.

Last updated

Was this helpful?