# RadzenPassword Class

A password input component that masks entered characters for secure password entry with autocomplete support. RadzenPassword provides a styled password field with browser autocomplete integration for password managers. Displays entered characters as dots or asterisks to protect sensitive data from shoulder surfing, integrates with browser password managers by setting appropriate autocomplete attributes. Supports data binding, validation, placeholder text, and read-only mode for display purposes. Use within forms for login, registration, password change, or any scenario requiring secure text entry.

Namespace: [Radzen.Blazor](https://blazor.radzen.com/docs/api/Radzen.Blazor.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- ComponentBase
- [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md)
- [FormComponent<string>](https://blazor.radzen.com/docs/api/Radzen.FormComponent-1.md)
- [FormComponentWithAutoComplete<string>](https://blazor.radzen.com/docs/api/Radzen.FormComponentWithAutoComplete-1.md)
- RadzenPassword

## Implements

- IComponent
- IHandleEvent
- IHandleAfterRender
- [IRadzenFormComponent](https://blazor.radzen.com/docs/api/Radzen.IRadzenFormComponent.md)

## Syntax

```csharp
public class RadzenPassword : FormComponentWithAutoComplete<string>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent
```

## Examples

Basic password input:

```razor
<RadzenPassword @bind-Value=@password Placeholder="Enter password" />
```

Password confirmation with validation:

```razor
<RadzenTemplateForm Data=@model>
    <RadzenPassword Name="Password" @bind-Value=@model.Password Placeholder="Password" />
    <RadzenRequiredValidator Component="Password" Text="Password is required" />
    <RadzenPassword Name="ConfirmPassword" @bind-Value=@model.ConfirmPassword Placeholder="Confirm password" />
    <RadzenCompareValidator Value=@model.Password Component="ConfirmPassword" Text="Passwords must match" />
</RadzenTemplateForm>
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenPassword()` | A password input component that masks entered characters for secure password entry with autocomplete support. RadzenPassword provides a styled password field with browser autocomplete integration for password managers. Displays entered characters as dots or asterisks to protect sensitive data from shoulder surfing, integrates with browser password managers by setting appropriate autocomplete attributes. Supports data binding, validation, placeholder text, and read-only mode for display purposes. Use within forms for login, registration, password change, or any scenario requiring secure text entry. |

## Properties

| Property | Type | Description |
|------|------|-------------|
| DefaultAutoCompleteAttribute | `string` |  |
| Immediate | `bool` | Gets or sets whether the component should update the bound value immediately as the user types (oninput event), rather than waiting for the input to lose focus (onchange event). This enables real-time value updates but may trigger more frequent change events. |
| InputSize | [`InputSize`](https://blazor.radzen.com/docs/api/Radzen.InputSize.md) | Gets or sets the size of the component. |
| ReadOnly | `bool` | Gets or sets whether the password input is read-only and cannot be edited. When true, displays the masked value (or placeholder) but prevents user input. Useful for displaying password field in view-only forms, though typically passwords are not displayed at all. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `BuildRenderTree(Rendering.RenderTreeBuilder __builder)` | `void` |  |
| `GetComponentCssClass()` | `string` |  |
| `GetId()` | `string` |  |
| `SetValue(string value)` | `Task` | Handles the @bind:set binding of the underlying input element. Parameters: `value`: The new value reported by the input/change event. |

## Inherited Members

- From [FormComponentWithAutoComplete<string>](https://blazor.radzen.com/docs/api/Radzen.FormComponentWithAutoComplete-1.md): AriaAutoCompleteAttribute, AutoCompleteAttribute, AutoCompleteType, DefaultAriaAutoCompleteAttribute, SetParametersAsync
- From [FormComponent<string>](https://blazor.radzen.com/docs/api/Radzen.FormComponent-1.md): Change, CurrentPlaceholder, Disabled, Dispose, EditContext, FieldIdentifier, FocusAsync, Form, FormFieldContext, GetClassList, GetValue, HasValue, IsBound, Name, NotifyFieldChanged, OnContextMenu, Placeholder, TabIndex, Value, ValueChanged, ValueExpression, _value
- From [RadzenComponent](https://blazor.radzen.com/docs/api/Radzen.RadzenComponent.md): AddContextMenu, Attributes, ContextMenu, Culture, CurrentStyle, Debounce, DefaultCulture, DefaultUICulture, Element, GetCssClass, GetIdAttribute, IsJSRuntimeAvailable, JSRuntime, Localize, MouseEnter, MouseLeave, OnAfterRenderAsync, OnBecameInvisible, OnInitialized, OnMouseEnter, OnMouseLeave, RaiseContextMenu, RaiseMouseEnter, RaiseMouseLeave, Reference, Style, UICulture, UniqueID, Visible
- From ComponentBase: Assets, AssignedRenderMode, DispatchExceptionAsync, InvokeAsync, OnAfterRender, OnInitializedAsync, OnParametersSet, OnParametersSetAsync, RendererInfo, ShouldRender, StateHasChanged

