OnSive.MudPasswordInput
1.0.0-rc.2
Prefix Reserved
This is a prerelease version of OnSive.MudPasswordInput.
dotnet add package OnSive.MudPasswordInput --version 1.0.0-rc.2
NuGet\Install-Package OnSive.MudPasswordInput -Version 1.0.0-rc.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OnSive.MudPasswordInput" Version="1.0.0-rc.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OnSive.MudPasswordInput --version 1.0.0-rc.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OnSive.MudPasswordInput, 1.0.0-rc.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OnSive.MudPasswordInput as a Cake Addin #addin nuget:?package=OnSive.MudPasswordInput&version=1.0.0-rc.2&prerelease // Install OnSive.MudPasswordInput as a Cake Tool #tool nuget:?package=OnSive.MudPasswordInput&version=1.0.0-rc.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Password Strength Component for Blazor using MudBlazor
This Blazor component provides a password input field with real-time strength validation using MudBlazor. The strength is visually represented by four colored bars and a textual description. Additionally, it provides guidelines for creating a strong password.
Roadmap for 1.0.0
- Bar count and text in dependency to total score #2
- Color dynamically by range between 0 and total score #1
- Custom colors #1
- More translations → open for suggestions #3
- Custom password rules 1.0.0-rc.1
- Colored bars for password strength 1.0.0-rc.1
- Show password button 1.0.0-rc.1
- Score system for password strength 1.0.0-rc.1
Features
- Password input with strength validation
- Strength represented by four bars (red to green)
- Visibility toggle for password field
- Checklist for improving password security
- Localization
- english
- german
Installation
- Install the MudBlazor package via NuGet:
dotnet add package OnSive.MudPasswordInput --version 1.0.0-rc.1
- Add the stylesheet
<link href="_content/OnSive.MudPasswordInput/OnSive.MudPasswordInput.css" rel="stylesheet"/>
- Add MudBlazor (official MudBlazor installation guide)
- Add the namespace to the
_Imports.razor
files@using OnSive.MudPasswordInput
Usage
Include the component in your Blazor page:
<MudPasswordInput @bind-Password="_password"
Checks="_checks"/>
@code{
private string _password = "";
private IEnumerable<PasswordRule> _checks =
[
PasswordRule.AtLeastXCharacters(6),
PasswordRule.IncludeUppercase(),
PasswordRule.IncludeNumbers(),
PasswordRule.IncludeSpecialCharacters(),
new PasswordRule()
{
Check = x => false,
Description = "Foo Bar"
}
];
}
[Parameter] public string Label { get; set; } = Localized.Password; // Sets the field label
[Parameter] public bool ShowDetails { get; set; } = true; // Sets weather the password strength checklist is visible or not
[Parameter] public string Password { get; set; } // The two-way bindable password
[Parameter] public Variant Variant { get; set; } // Default MudBlazor field variant parameter
[Parameter, EditorRequired] public IEnumerable<PasswordRule> Checks { get; set; } // The list of password strenth checks
Password Strength Criteria
Predefined:
- At least X characters
- Includes uppercase letters
- Includes numbers
- Uses special characters
Custom
Add your own
new PasswordRule()
{
Description = "My description", // Can be localized like you do normally
Func<string, bool> Check = x => FooBar(x) == true; // Your custom check logic
int Score { get; set; } = 1; // Optional: Set the score for this check to influence the total password strenth more
}
License
This project is licensed under the MIT License.
Contribution
Feel free to submit issues and pull requests to improve the component.
Author
Developed by Hille (OnSive.net)
Third Party
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- MudBlazor (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-rc.2 | 37 | 2/6/2025 |
1.0.0-rc.1 | 19 | 2/6/2025 |