______ __
/ ____/___ ____ ___ ____ ____ ____ ___ ____ / /______
/ / / __ \/ __ `__ \/ __ \/ __ \/ __ \/ _ \/ __ \/ __/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ / / / / __/ / / / /_(__ )
\____/\____/_/ /_/ /_/ .___/\____/_/ /_/\___/_/ /_/\__/____/
/_/
A collection of reusable Blazor components and abstractions to help build cross platform rich application experiences for desktop and web in blazor.
This repository contains a set of custom Blazor components that extend the functionality of MudBlazor, providing a consistent and reusable component library for Mythetech applications. The components are designed to be modular, maintainable, and follow best practices for Blazor development.
The repository also contains abstractions for functionality to work generically with blazor applications acknowledging the behavior for some interactions is broadly different across runtime environments, like desktop in a webview versus natively in WebAssembly in the browser.
The component library leverages BlazingStory to create a visual storybook of components shipped in the library, with wrappings to provide product-themed previews and light/dark toggles.
The WebAssembly story book is hosted on github pages here: https://mythetech.github.io/Mythetech.Components/
- Custom components to either deliver a unique experience or style
- Built on top of MudBlazor for consistent styling, behavior, and themeing system
- CSS utility classes that work with existing MudBlazor variables
- .NET 9.0 support
- Comprehensive test coverage
Mythetech.Components/
- Main component libraryComponents/
- Custom Blazor componentsInfrastructure/
- Supporting infrastructure code and abstractions
Mythetech.Components.Desktop/
- Desktop application specific implementationsMythetech.Components.WebAssembly/
- WebAssembly specific implementationsMythetech.Components.Storybook/
- Component documentation and showcaseMythetech.Components.Test/
- Unit tests for components
- .NET 9.0 SDK
- Visual Studio 2022 or later (recommended)
- Clone the repository
- Open the solution in Visual Studio
- Restore NuGet packages
- Build the solution
To use these components in your Blazor application:
- Add a reference to the
Mythetech.Components
project - Add the following to your
_Imports.razor
:
@using Mythetech.Components
- Register the services in your
Program.cs
:
The component library provides a lightweight message bus for commands/events
builder.Services.AddMessageBus();
...
app.Services.UseMessageBus(typeof(Program).Assembly, typeof(IConsumer<>).Assembly);
The library has additional packages to provide concrete implementations for the underlying hosting architecture so generic components and concepts can work across discrete runtimes.
With desktop:
builder.Services.AddPhotinoServices();
...
BlazorPhotinoApp app = appBuilder.Build();
app.RegisterProvider(app.Services);
The project includes a comprehensive test suite. To run the tests:
- Open the solution in Visual Studio
- Use the Test Explorer to run individual tests
- Or run all tests using the command line:
dotnet test
The project includes a Storybook implementation for component documentation and testing. To run Storybook:
- Navigate to the
Mythetech.Components.Storybook
directory - Run the project:
dotnet run
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the terms included in the LICENSE file.
For support, please open an issue in the GitHub repository.