PasswordTextBox Blazor API

PasswordTextBox Properties

NameTypeDefaultDescription
AutoFocusboolfalseIndicates that the element will automatically receive keyboard focus as soon as the page is loaded, allowing users to interact with it immediately without clicking or tabbing to it. This is often used to improve accessibility and streamline user interaction with form fields or interactive elements.
DisabledboolfalseDetermines whether the element is interactive or inactive. When enabled, users can interact with the element; when disabled, the element becomes unresponsive to user actions such as clicks or input.
EnterKeyBehaviorEnterKeyBehaviorEnterKeyBehavior.SubmitDefines the action that occurs when the "Enter" key is pressed within the input field. By default, the mode is set to "submit", meaning pressing "Enter" will attempt to submit the associated form. You can customize this behavior by specifying alternative modes, such as preventing form submission or triggering a custom handler.
Formstring""Specifies the form element with which this element is associated (referred to as its "form owner"). The value of this attribute should be the id of a
element within the same HTML document. This allows the element to be associated with a form even if it is not nested inside the tags.
HintobjectN/ADisplays supplemental helper text beneath the element, visible only while the element is focused. This text provides additional guidance or context to users during interaction.
Labelstring""Displays a label positioned above the input element. This label remains persistently visible, providing a clear and accessible description of the input’s purpose at all times.
UnlockKeystring""Gets or sets the unlockKey, a unique key required to activate and access the product. Use this property to retrieve the current unlock key or assign a new one to enable product unlocking functionality.
Localestring"en"Specifies or retrieves the current language setting. This property determines which set of localized text strings from the messages property is used for display. When you set the language, the corresponding messages are shown to users in that language. When you get the language, it returns the currently active language code.
MaxLengthintN/ASpecifies or retrieves the maximum number of characters allowed in the input field. If set, the user cannot enter more characters than this limit. This constraint helps enforce data validation and control the input length.
MessagesobjectN/ADefines an object where each property corresponds to a specific password strength state, with associated string values that describe or label each state (e.g., "weak," "moderate," "strong"). This object is typically used to display feedback messages or labels reflecting the current strength of a user's password during input.
MinLengthint2Specifies or retrieves the minimum number of characters required for user input. When set, the user must enter at least this many characters for the input to be considered valid.
Namestring""Sets or retrieves the value of the element's name attribute. The name attribute is used to identify form fields when submitting HTML forms, allowing the data entered in the element to be included in the form's submission with the specified name as the key. This is essential for server-side processing of form data.
PasswordStrengthobjectN/AWith this property, you can specify a custom callback function that evaluates the strength of a password. The function should accept the current password as input and return a string representing the assessed strength level. The returned string must be one of the following predefined values: 'short', 'weak', 'far', 'good', or 'strong'. This value will be used by the component to indicate how secure the entered password is according to your custom logic.
Placeholderstring""This is the text that appears within the element when it is empty, serving as a prompt or hint to the user about the expected input. Once the user enters a value, this placeholder text disappears.
RequiredboolfalseEnhances the requirement that the user must provide a value for this element before the form can be submitted. If this field is left empty, the form submission will be blocked and the user will be prompted to enter a value. This ensures that the input is mandatory, helping maintain data completeness and integrity.
RightToLeftboolfalseSets or retrieves a value specifying whether the element’s alignment is adjusted to support right-to-left (RTL) languages, such as Arabic or Hebrew. When enabled, the element’s content and layout are adapted for proper display in locales that use right-to-left text direction.
SelectAllOnFocusboolfalseDetermines if the entire content of the input field should be automatically highlighted (selected) when the input receives focus, making it easier for users to quickly replace or copy the content.
ShowPasswordIconboolfalseSpecifies whether the password icon (such as an eye symbol to show or hide password text) is displayed in the input field.
ShowPasswordStrengthboolfalseSpecifies whether a tooltip displaying the password strength indicator will be visible to the user during password entry. When enabled, this tooltip provides real-time feedback on the strength of the entered password.
Themestring""Specifies the visual theme to be applied. The theme controls the overall appearance and style—including colors, fonts, and backgrounds—of the element for a consistent look and feel.
TooltipArrowboolfalseSpecifies whether the Tooltip component should display an arrow pointing to the target element. Setting this option to true will show the arrow, while false will hide it.
TooltipDelayint0Specifies the amount of time, in milliseconds, to wait before displaying the tooltip after a user interaction (such as hovering or focusing on an element).
TooltipPositionPasswordTextBoxTooltipPositionPasswordTextBoxTooltipPosition.TopSpecifies the placement of the tooltip relative to the target element, such as "top", "bottom", "left", or "right". This controls where the tooltip will appear when it is displayed.
TooltipTemplatestring"null"Specifies a custom template for rendering the tooltip’s content, allowing you to define the layout, formatting, and dynamic data within the tooltip. This enables greater control over the appearance and behavior of the tooltip beyond the default content.
UnfocusableboolfalseIndicates whether the element should be excluded from keyboard navigation and cannot receive focus. If set to true, users will not be able to focus on the element using the keyboard or mouse interactions.
Valuestring""Sets a new value for the element or retrieves its current value, depending on whether an argument is provided. Useful for updating or accessing the element’s data within a form or component.

PasswordTextBox Methods

NameTypeArgumentsDescription
GetValueAsync()Task<string>'N/A'Gets the &quot;Value&quot; property as Task&lt;string&gt;.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
ResetvoidN/AThis method resets the input field to its initial value, discarding any changes made by the user and restoring the input's original state as specified when the component or element was first rendered.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

PasswordTextBox Events

NameTypeDescriptionEvent Detail
OnChangeEventCallback<Event>This event is triggered whenever the value of the element is modified by the user or through programmatic changes. It occurs after the change has been committed, allowing you to respond to updates in the element’s value.dynamic oldValue- The previous value of the element before it was changed., dynamic value- The new value of the element.
Changedevent PasswordTextBoxChangedEventHandlerThis event is triggered whenever the value of the element is modified by the user or through programmatic changes. It occurs after the change has been committed, allowing you to respond to updates in the element’s value.PasswordTextBoxChangedEventArgs
OnChangingEventCallback<Event>This event is triggered whenever a key is released (key up) within the TextBox, but only if the TextBox's value has changed as a result of the key press. This ensures that the event fires solely when user input modifies the content, preventing unnecessary triggers when the value remains unchanged.dynamic oldValue- The previous value before it was changed., dynamic value- The new value.
Changingevent PasswordTextBoxChangingEventHandlerThis event is triggered whenever a key is released (key up) within the TextBox, but only if the TextBox's value has changed as a result of the key press. This ensures that the event fires solely when user input modifies the content, preventing unnecessary triggers when the value remains unchanged.PasswordTextBoxChangingEventArgs

Enums

EnterKeyBehavior

EnterKeyBehavior.ClearOnSubmit
EnterKeyBehavior.Submit

PasswordTextBoxTooltipPosition

PasswordTextBoxTooltipPosition.Absolute
PasswordTextBoxTooltipPosition.Bottom
PasswordTextBoxTooltipPosition.Top
PasswordTextBoxTooltipPosition.Left
PasswordTextBoxTooltipPosition.Right