https://github.com/mudblazor/thememanager
ThemeManager built to showcase MudBlazor theming.
https://github.com/mudblazor/thememanager
Last synced: about 1 year ago
JSON representation
ThemeManager built to showcase MudBlazor theming.
- Host: GitHub
- URL: https://github.com/mudblazor/thememanager
- Owner: MudBlazor
- License: mit
- Created: 2021-02-28T12:20:03.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-01-18T19:31:27.000Z (over 1 year ago)
- Last Synced: 2025-04-12T14:57:30.366Z (about 1 year ago)
- Language: C#
- Homepage:
- Size: 63.7 MB
- Stars: 238
- Watchers: 21
- Forks: 65
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Theme Manager / Generator for MudBlazor
[](https://github.com/Garderoben/MudBlazor.ThemeManager/blob/master/LICENSE)
[](https://twitter.com/MudBlazor)
[](https://www.nuget.org/packages/MudBlazor.ThemeManager/)
[](https://discord.gg/mudblazor)
Blazor Theme Manager component for MudBlazor library. Can be used live or during development to fast and easy try out different theme settings.
**This component is currently not suitable for production applications, be ready for performance issues, bugs and missing features. Feel free to help improve it.**
## Workflow

## Prerequisites
- [MudBlazor](https://www.mudblazor.com/getting-started/installation) Installed and configurated.
## Installation
Install Package
```
dotnet add package MudBlazor.ThemeManager
```
Add the following to `_Imports.razor`
```razor
@using MudBlazor.ThemeManager
```
Add the following to your HTML `head` section, it's either `index.html` or `_Layout.cshtml`/`_Host.cshtml`/`App.razor` depending on whether you're running WebAssembly or Server.
```razor
```
Add the components in your `MainLayout.razor` and inside ``
```razor
```
Add the following inside your @code for `MainLayout.razor`
```razor
private ThemeManagerTheme _themeManager = new ThemeManagerTheme();
public bool _themeManagerOpen = false;
void OpenThemeManager(bool value)
{
_themeManagerOpen = value;
}
void UpdateTheme(ThemeManagerTheme value)
{
_themeManager = value;
StateHasChanged();
}
protected override void OnInitialized()
{
StateHasChanged();
}
```
Connect the ThemeManagerTheme with `MudThemeProvider` to control all the theme colors. You can also connect `MudAppBar` and `MudDrawer` directly.
```html
```