MudBlazor.StaticInput is an extension package for the MudBlazor library.
Tailored specifically for Static Server-Side Rendered (static SSR) pages. It offers seamless integration of MudBlazor's Component design into your applications. Focusing particularly on components designed for forms and edit forms, in situations where interactive components are not feasible.
[example: Blazor Identity UI].
- Rapid SSSR Integration: Effortlessly add MudBlazor components to your static SSR pages, saving development time.
- Focus on Forms: Streamline development of forms and edit forms, for use cases such as Microsoft Identity Login forms.
- Preserved Look & Feel: Maintains the consistent design and user experience of MudBlazor. Ensuring uniformity across all pages.
- Maintains Flexibility: By inheriting core MudBlazor components, StaticInput maintains the same flexibility as the original components.
The set of components and features may extend over time. Currently, StaticInput components include:
A Material Design button that supports form actions such as 'submit' and 'reset'
<MudStaticButton Variant="Variant.Filled" Color="Color.Primary">Login</MudStaticButton>
Note:
<MudButton>
is 100% functional in forms when used correctly. The static component simply assists in assuring the correct usage.
Checkboxes are a great way to allow the user to make a selection of choices.
<MudStaticCheckBox @bind-Value="@RememberMe" Color="Color.Success">Remember Me</MudStaticCheckBox>
@code{
public bool RememberMe { get; set; }
}
Similar to a checkbox but visually different. The switch lets the user switch between two values with the tap of a button.
<MudStaticSwitch @bind-Value="@RememberMe" Color="Color.Success" UnCheckedColor="Color.Primary">Remember Me</MudStaticSwitch>
@code{
public bool RememberMe { get; set; }
}
Text field components are used for receiving user provided information
<MudStaticTextField @bind-Value="@Password"
InputType="InputType.Password"
Adornment="Adornment.End"
AdornmentIcon="@Icons.Material.Outlined.VisibilityOff"
AdornmentClickFunction="showPassword" />
@code {
public string Password { get; set; }
}
<script>
let timeoutId;
function showPassword(inputElement, button) {
if (inputElement.type === 'password') {
inputElement.type = 'text';
clearTimeout(timeoutId);
timeoutId = setTimeout(function () {
inputElement.type = 'password';
}, 5000);
} else {
inputElement.type = 'password';
clearTimeout(timeoutId);
}
}
</script>
Open/Close a MudDrawer using a MudIconButton. When added, Responsive drawers also open/close based on page size changes.
<MudStaticNavDrawerToggle id="static-left-toggle" DrawerId="static-mini" Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" />
<MudDrawer id="static-mini" Fixed="false" Elevation="1" Anchor="Anchor.Start" Variant="@DrawerVariant.Mini" ClipMode="DrawerClipMode.Always">
<MudNavMenu>
<MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Store">Store</MudNavLink>
<MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.LibraryBooks">Library</MudNavLink>
<MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.Group">Community</MudNavLink>
</MudNavMenu>
</MudDrawer>
Collapse/Expand a MudStaticNavGroup by clicking on it's title. Can you nested in a standard MudNavMenu
<MudNavMenu>
<MudNavLink Href="/dashboard">Dashboard</MudNavLink>
<MudNavLink Href="/servers">Servers</MudNavLink>
<MudNavLink Href="/billing" Disabled="true">Billing</MudNavLink>
<MudStaticNavGroup Title="Settings" Expanded="true">
<MudNavLink Href="/users">Users</MudNavLink>
<MudNavLink Href="/security">Security</MudNavLink>
</MudStaticNavGroup>
<MudNavLink Href="/about">About</MudNavLink>
</MudNavMenu>
To start using MudBlazor.StaticInput in your projects, simply install the package via NuGet Package Manager:
dotnet add package Extensions.MudBlazor.StaticInput
Then add the following to the body
of your App.razor
file
<script src="_content/Extensions.MudBlazor.StaticInput/NavigationObserver.js"></script>
Note: MudBlazor should already be setup for your application