Switch theme in Blazor Web App .NET8

Hey there,

We will soon start building a new application with Radzen components. We are currently planning the application and one of the requirements is that there should be a (Switch) component that can switch between the "Material 3" theme & the "Material 3 Dark" theme. Is there anything documented about this because I can't find anything?

And how does this work with Radzen Blazor Studio? Will we be able to style both themes?

Hi @kalsson,

No, we don't have this documented. You can however check how theme switching is implemented in the online demos.

  1. ThemeService.cs - a service that has to be registered and maintains the current theme
  2. Theme.razor (includes the current theme css file)
  3. How to use the Theme component: radzen-blazor/RadzenBlazorDemos.Host/App.razor at master · radzenhq/radzen-blazor · GitHub

No, it won't work out of the box. Radzen Blazor Studio can customize only one theme at a time. The customization is a set of CSS rules however which can be extracted in a separate CSS file(s) and included after the theme CSS file.

Hey @korchev ,

Thank you! :+1: