SmugglerCode.Blazor.UI
1.0.4
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SmugglerCode.Blazor.UI --version 1.0.4
NuGet\Install-Package SmugglerCode.Blazor.UI -Version 1.0.4
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="SmugglerCode.Blazor.UI" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SmugglerCode.Blazor.UI" Version="1.0.4" />
<PackageReference Include="SmugglerCode.Blazor.UI" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SmugglerCode.Blazor.UI --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SmugglerCode.Blazor.UI, 1.0.4"
#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.
#:package SmugglerCode.Blazor.UI@1.0.4
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SmugglerCode.Blazor.UI&version=1.0.4
#tool nuget:?package=SmugglerCode.Blazor.UI&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SmugglerCode.Blazor.UI
A reusable Blazor UI component library.
This library provides well-structured, customizable UI components built with Blazor for modern web applications.
Currently, the library includes a Button component, with more components planned and actively being developed.
Components
Button
A flexible button component with multiple styles, interactivity options, and support for child content.
Features
- Supports predefined button types (
Primary,Alert) - Accepts a
Labelstring or arbitrary child content - Handles click events via
EventCallback - CSS class management based on button type
- Hover-based coloring for visual feedback
IsVisibleflag to show or hide the button (default:true)IsDisableflag to enable or disable the button- Inherits disabled state from parent components via cascading parameter
Usage example
@using SmugglerCode.Blazor.UI.Components.Buttons
<Button
Label="Click me"
Type="ButtonType.Primary"
IsVisible="true"
IsDisable="false"
OnClick="@OnButtonClicked" />
@code {
private void OnButtonClicked()
{
// Your click handling logic here
}
}
TextBox<TValue>
A generic input component for text-based user input with type safety and event handling.
Features
- Supports two-way binding via Text and TextChanged
- Optional OnEnter callback for Enter key handling
- Converts input values from string to the correct TValue
- IsDisabled and inherited cascading IsDisabled support
- IsVisible flag to toggle component visibility
- Applies disabled attribute and styles when disabled
- Switching between dynamic or fixed sizing for the text box
Usage example
@using SmugglerCode.Blazor.UI.Components.Inputs
<TextBox TValue="int"
Text="@value"
TextChanged="@((int? val) => value = val)"
OnEnter="@OnEnterPressed"
IsDisabled="false"
IsVisible="true" />
@code {
private int? value;
private void OnEnterPressed(int? val)
{
Console.WriteLine($"Enter pressed, value: {val}");
}
}
Usage example dynamic sizing
@using SmugglerCode.Blazor.UI.Components.Common
<DynamicCssScope IsDynamicSize="_isDynamicSize">
<TextBox @bind-Text="_customerName"></TextBox>
<TextBox @bind-Text="_customerLastName"></TextBox>
...
</DynamicCssScope>
| 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- Microsoft.AspNetCore.Components.Web (>= 9.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.